Skip to content

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Jan 14, 2026

What does this PR do?

Changes as per latest server specs, these include -

  1. Updates to Runtime enums
  2. Output is now correctly renamed to ImageFormat
  3. Introduces Backups module for managing Database backups
  4. Introduces Organization module

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

Summary by CodeRabbit

Release Notes – v20.1.1

  • Breaking Changes

    • Output enum renamed to ImageFormat
  • New Features

    • Backups service: manage backup archives, policies, and restorations
    • Organization service: manage organizations and deletion estimations
    • Queue health monitoring: new endpoints for billing aggregation, build priority, region manager, and threat detection
    • Optional duration parameter for JWT token creation
  • Documentation

    • Added comprehensive examples for Backups and Organization APIs
    • Updated SDK compatibility to latest server version

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 14, 2026

Walkthrough

This pull request updates the Appwrite Ruby SDK from version 20.1.0 to 20.1.1, introducing new Backups and Organizations service modules with associated model classes. The Output enum is renamed to ImageFormat as a breaking change. New documentation examples are added for the backup and organization APIs, and health service endpoints are introduced for queue monitoring. Several Deno runtime versions are removed from enum definitions. Existing models (Bucket, Database, File) are extended with new attributes. The LICENSE copyright year is updated to 2026.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.63% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Updates: sync as per latest cloud specs' is vague and generic, using non-descriptive language that doesn't clearly convey the main changes (Runtime enum updates, Output→ImageFormat rename, new Backups/Organization modules). Consider a more specific title that highlights primary changes, such as 'Add Backups and Organization modules, rename Output to ImageFormat' or 'Sync SDK with latest server specifications including backup support'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ItzNotABug ItzNotABug self-assigned this Jan 14, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 19

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
lib/appwrite/services/tables_db.rb (1)

1963-2001: The get_column method hardcodes response type to Models::ColumnBoolean, preventing retrieval of other column types.

This method accepts a generic key parameter and calls the generic API endpoint /tablesdb/{databaseId}/tables/{tableId}/columns/{key}, which can return any column type. However, the response is hardcoded to deserialize as ColumnBoolean, causing incorrect type casting for string, datetime, integer, and other column types.

Users cannot retrieve non-boolean columns using this method. Either:

  1. Remove the response_type parameter to return raw response data
  2. Add a type parameter to get_column and conditionally set the response type based on the actual column's type attribute
  3. Remove this generic method and require users to use type-specific create/update methods
lib/appwrite/services/databases.rb (1)

2106-2112: Remove deprecated method or fix hardcoded response type.

This method is marked @deprecated since 1.8.0 (line 2073) with a directive to use TablesDB.getColumn instead. Since it's not used anywhere in the codebase and is deprecated, consider removing it entirely rather than maintaining incorrect code.

If kept for backward compatibility, the hardcoded Models::AttributeBoolean response type is incorrect for a generic attribute getter that can retrieve attributes of any type (String, Integer, Float, Datetime, Enum, etc.). Either remove the response_type parameter or align it with the actual return value.

🤖 Fix all issues with AI agents
In `@docs/examples/health/get-queue-billing-project-aggregation.md`:
- Line 13: The YAML example sets the Ruby value incorrectly as "threshold:
null"; change this to "threshold: nil" so Ruby will use its nil object instead
of an undefined constant — update the "threshold" key in the example snippet
accordingly.

In `@docs/examples/health/get-queue-priority-builds.md`:
- Line 13: The YAML example sets "threshold: null" which is incorrect for Ruby
contexts; change the value to "threshold: nil" so Ruby code uses the proper nil
literal instead of the undefined null (replace the "threshold: null" line with
"threshold: nil" in the example).

In `@docs/examples/health/get-queue-region-manager.md`:
- Line 13: The YAML example sets threshold: null which is invalid in Ruby
examples; change the value from null to nil so the Ruby code uses nil for the
threshold field (update the "threshold" entry in the example to use nil).

In `@docs/examples/health/get-queue-threats.md`:
- Line 13: Replace the invalid Ruby literal by changing the YAML example's
threshold value from null to Ruby's nil (i.e., update the "threshold: null" line
to "threshold: nil") so the Ruby example uses the correct nil value and avoids a
NameError at runtime.

In `@lib/appwrite/models/backup_policy_list.rb`:
- Line 1: Update the magic comment at the top of
lib/appwrite/models/backup_policy_list.rb so Ruby recognizes the pragma: change
"#frozen_string_literal: true" to include a space after the hash, i.e. "#
frozen_string_literal: true". Ensure this corrected comment appears as the first
line of the file.

In `@lib/appwrite/models/database.rb`:
- Around line 43-44: The concern about using Index.from and Collection.from is
incorrect—those are the correct types for database-level policies and
archives—so leave the calls to policies: map["policies"].map { |it|
Index.from(map: it) } and archives: map["archives"].map { |it|
Collection.from(map: it) } as-is for type correctness; if you want to follow
existing defensive nil-safety patterns across the SDK, guard against missing
keys by changing the input to (map["policies"] || []) and (map["archives"] ||
[]) before calling .map so the code becomes (map["policies"] || []).map { |it|
Index.from(map: it) } and (map["archives"] || []).map { |it|
Collection.from(map: it) }.

In `@lib/appwrite/models/estimation_delete_organization.rb`:
- Line 1: The magic comment at the top of estimation_delete_organization.rb is
malformed ("#frozen_string_literal: true"); update it to the correct Ruby magic
comment format by adding a space so it reads as the proper pragma (e.g., change
the "#frozen_string_literal: true" line to include a space after the hash) to
ensure Ruby recognizes frozen_string_literal.
- Around line 14-18: EstimationDeleteOrganization.from currently calls map on
map["unpaidInvoices"] which can be nil and raise NoMethodError; update the from
constructor to guard against missing or nil unpaidInvoices by defaulting to an
empty array (e.g., use (map["unpaidInvoices"] || []) or safe navigation) before
mapping to Invoice.from so unpaid_invoices is always an array of Invoice objects
(refer to EstimationDeleteOrganization.from and Invoice.from).

In `@lib/appwrite/models/invoice.rb`:
- Line 86: The current deserialization in invoice.rb calls map["usage"].map {
|it| UsageResources.from(map: it) } which will raise NoMethodError if
map["usage"] is nil or missing; update this to guard against nil by either using
the safe-navigation operator on map["usage"] or defaulting it to an empty array
before mapping so that UsageResources.from is only called for real elements and
the field yields an empty array when absent.
- Line 113: The serialization calls `@usage.map` { |it| it.to_map } which will
raise NoMethodError if `@usage` is nil; make it nil-safe by replacing with a guard
such as `@usage`&.map { |it| it.to_map } or (`@usage` || []).map { |it| it.to_map }
so the Invoice model's serialization returns an empty array when usage is nil
and avoids calling to_map on nil.

In `@lib/appwrite/services/backups.rb`:
- Around line 235-241: The update_policy method constructs api_path using
policy_id before validating it, which can cause errors; move the nil-check for
policy_id (raising Appwrite::Exception) to occur before the api_path
construction so you validate the required parameter first (i.e., check
policy_id.nil? and raise the exception at the top of update_policy, then build
api_path with .gsub('{policyId}', policy_id)).
- Around line 268-274: In delete_policy, the code constructs api_path by calling
.gsub with policy_id before validating it; move the nil check for policy_id so
it runs before building api_path (i.e., validate policy_id and raise
Appwrite::Exception if nil at the start of delete_policy), then construct
api_path using the now-validated policy_id.
- Around line 98-104: In delete_archive (method delete_archive) the nil check
for archive_id happens after you call .gsub on the template path; move the
validation check for archive_id to before you build api_path (before calling
.gsub('{archiveId}', archive_id)) so you raise Appwrite::Exception.new('Missing
required parameter: "archiveId"') when archive_id is nil and avoid calling gsub
on nil.
- Around line 203-209: In get_policy(policy_id:) ensure the nil check for
policy_id happens before using it in api_path; move the existing if
policy_id.nil? raise Appwrite::Exception... block to precede the api_path =
'/backups/policies/{policyId}'.gsub('{policyId}', policy_id) line so you
validate the parameter first and only then build the path (refer to method
get_policy, variable policy_id, and api_path/gsub).
- Around line 359-365: In get_restoration, validate restoration_id before using
it to build api_path to avoid calling .gsub on nil; move the nil check (raise
Appwrite::Exception.new('Missing required parameter: "restorationId"')) above
the api_path assignment so restoration_id is verified first.
- Around line 70-76: In get_archive(archive_id:) move the nil validation before
you call gsub so archive_id is checked first; specifically, ensure the
Appwrite::Exception for missing "archiveId" is raised prior to constructing
api_path (the '/backups/archives/{archiveId}'.gsub(...) call) so a nil
archive_id triggers the intended Appwrite::Exception instead of a TypeError.

In `@lib/appwrite/services/organizations.rb`:
- Around line 15-21: In the delete method the nil check for organization_id
happens after using it in the api_path substitution causing a TypeError; move
the validation so the method raises Appwrite::Exception.new('Missing required
parameter: "organizationId"') if organization_id.nil? before constructing
api_path (the '/organizations/{organizationId}'.gsub(...) call) so substitution
only runs on a validated non-nil organization_id.
- Line 1: The file has a malformed magic comment "#frozen_string_literal: true"
at the top; fix it by adding the required space after the hash so it reads "#
frozen_string_literal: true" (mirror the same fix applied in the model file) to
comply with Ruby magic comment formatting.
- Around line 43-49: In estimation_delete_organization, perform the nil-check
for organization_id before constructing api_path (i.e., before calling
.gsub('{organizationId}', organization_id)); if organization_id is nil raise
Appwrite::Exception.new('Missing required parameter: "organizationId"') first,
then build api_path using .gsub('{organizationId}', organization_id) so the
error message is clear and substitution never runs with a nil value.
🧹 Nitpick comments (10)
docs/examples/databases/upsert-document.md (1)

18-24: Improved example with realistic data.

The populated data payload makes this example more helpful for developers. The structure and syntax are correct.

Optional: Consider consistent example data across documentation.

The age field is 30 here, while other examples (update-documents.md, update-row.md, upsert-row.md) use 33. For consistency across documentation, consider using the same value.

📝 Optional consistency fix
         "username" => "walter.obrien",
         "email" => "[email protected]",
         "fullName" => "Walter O'Brien",
-        "age" => 30,
+        "age" => 33,
         "isAdmin" => false
docs/examples/organizations/delete.md (1)

8-8: Use a descriptive placeholder for the session value.

The empty string '' is inconsistent with other examples that use descriptive placeholders like '<YOUR_API_KEY>'. Consider using '<USER_SESSION>' for consistency and clarity.

Suggested fix
-    .set_session('') # The user session to authenticate with
+    .set_session('<USER_SESSION>') # The user session to authenticate with
README.md (1)

9-9: Consider specifying the server version instead of "latest".

Using "latest" loses specificity about which Appwrite server version this SDK targets. Users may find it helpful to know the exact compatible version (e.g., "1.8.x") rather than a vague "latest" which could become misleading as new server versions are released.

docs/examples/backups/create-archive.md (1)

12-15: Consider adding example values to the services array.

The empty services array is technically valid but doesn't guide users on what service identifiers are expected. Consider showing example service names (e.g., ['databases', 'storage']) to make the documentation more helpful.

docs/examples/backups/create-policy.md (1)

12-20: Consider providing more illustrative example values.

Two parameters could be more helpful with example values:

  • services: [] - Consider showing example service names (e.g., ['databases', 'storage'])
  • schedule: '' - Consider showing a valid schedule format (e.g., '0 0 * * *' for daily backups if cron format is expected)

This would make the documentation more instructive for users learning the API.

docs/examples/backups/create-restoration.md (1)

12-17: Consider adding example values to the services array.

The empty services array doesn't show users which services can be restored. Consider providing example service names (e.g., ['databases', 'storage']) to make the documentation more instructive.

lib/appwrite/models/backup_restoration_list.rb (1)

1-1: Minor: Missing space in frozen_string_literal pragma.

The pragma should have a space after # for proper formatting: # frozen_string_literal: true. While it may still work, the canonical form includes the space.

Suggested fix
-#frozen_string_literal: true
+# frozen_string_literal: true
lib/appwrite/models/backup_policy.rb (1)

1-1: Minor: Missing space in frozen_string_literal pragma.

Same as other model files - the pragma should be # frozen_string_literal: true with a space after #.

Suggested fix
-#frozen_string_literal: true
+# frozen_string_literal: true
lib/appwrite/models/backup_archive_list.rb (1)

1-1: Minor: Missing space in frozen_string_literal pragma.

Same as other model files - should be # frozen_string_literal: true.

Suggested fix
-#frozen_string_literal: true
+# frozen_string_literal: true
lib/appwrite/models/backup_archive.rb (1)

30-31: Minor formatting inconsistency.

The trailing spaces after resource_id: and resource_type: are unusual. While syntactically valid (these are required keyword arguments), consider removing the extra spaces for consistency with lines 20-29.

-                resource_id: ,
-                resource_type: 
+                resource_id:,
+                resource_type:
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29eef87 and 6ad9f0d.

📒 Files selected for processing (58)
  • CHANGELOG.md
  • LICENSE
  • README.md
  • appwrite.gemspec
  • docs/examples/account/create-jwt.md
  • docs/examples/avatars/get-screenshot.md
  • docs/examples/backups/create-archive.md
  • docs/examples/backups/create-policy.md
  • docs/examples/backups/create-restoration.md
  • docs/examples/backups/delete-archive.md
  • docs/examples/backups/delete-policy.md
  • docs/examples/backups/get-archive.md
  • docs/examples/backups/get-policy.md
  • docs/examples/backups/get-restoration.md
  • docs/examples/backups/list-archives.md
  • docs/examples/backups/list-policies.md
  • docs/examples/backups/list-restorations.md
  • docs/examples/backups/update-policy.md
  • docs/examples/databases/update-document.md
  • docs/examples/databases/update-documents.md
  • docs/examples/databases/upsert-document.md
  • docs/examples/health/get-queue-billing-project-aggregation.md
  • docs/examples/health/get-queue-billing-team-aggregation.md
  • docs/examples/health/get-queue-priority-builds.md
  • docs/examples/health/get-queue-region-manager.md
  • docs/examples/health/get-queue-threats.md
  • docs/examples/organizations/delete.md
  • docs/examples/organizations/estimation-delete-organization.md
  • docs/examples/tablesdb/update-row.md
  • docs/examples/tablesdb/update-rows.md
  • docs/examples/tablesdb/upsert-row.md
  • lib/appwrite.rb
  • lib/appwrite/client.rb
  • lib/appwrite/enums/build_runtime.rb
  • lib/appwrite/enums/name.rb
  • lib/appwrite/enums/o_auth_provider.rb
  • lib/appwrite/enums/output.rb
  • lib/appwrite/enums/runtime.rb
  • lib/appwrite/models/backup_archive.rb
  • lib/appwrite/models/backup_archive_list.rb
  • lib/appwrite/models/backup_policy.rb
  • lib/appwrite/models/backup_policy_list.rb
  • lib/appwrite/models/backup_restoration.rb
  • lib/appwrite/models/backup_restoration_list.rb
  • lib/appwrite/models/bucket.rb
  • lib/appwrite/models/database.rb
  • lib/appwrite/models/estimation_delete_organization.rb
  • lib/appwrite/models/file.rb
  • lib/appwrite/models/invoice.rb
  • lib/appwrite/models/usage_resources.rb
  • lib/appwrite/services/account.rb
  • lib/appwrite/services/avatars.rb
  • lib/appwrite/services/backups.rb
  • lib/appwrite/services/databases.rb
  • lib/appwrite/services/health.rb
  • lib/appwrite/services/organizations.rb
  • lib/appwrite/services/storage.rb
  • lib/appwrite/services/tables_db.rb
💤 Files with no reviewable changes (4)
  • lib/appwrite/enums/o_auth_provider.rb
  • lib/appwrite/enums/output.rb
  • lib/appwrite/enums/runtime.rb
  • lib/appwrite/enums/build_runtime.rb
🧰 Additional context used
🧬 Code graph analysis (8)
lib/appwrite/services/account.rb (1)
lib/appwrite/services/users.rb (1)
  • create_jwt (610-634)
lib/appwrite/models/backup_policy_list.rb (2)
lib/appwrite/models/backup_archive_list.rb (4)
  • attr_reader (5-30)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/models/backup_policy.rb (4)
  • attr_reader (5-75)
  • initialize (18-42)
  • from (44-58)
  • to_map (60-74)
lib/appwrite/services/health.rb (1)
lib/appwrite/client.rb (1)
  • call (147-157)
lib/appwrite/models/backup_policy.rb (2)
lib/appwrite/models/backup_archive.rb (4)
  • attr_reader (5-80)
  • initialize (19-45)
  • from (47-62)
  • to_map (64-79)
lib/appwrite/models/backup_policy_list.rb (4)
  • attr_reader (5-30)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/services/backups.rb (5)
lib/appwrite/services/account.rb (2)
  • initialize (4-1553)
  • initialize (6-8)
lib/appwrite/client.rb (3)
  • initialize (9-373)
  • initialize (11-22)
  • call (147-157)
lib/appwrite/models/backup_archive_list.rb (1)
  • initialize (9-15)
lib/appwrite/models/backup_policy_list.rb (1)
  • initialize (9-15)
lib/appwrite/models/backup_restoration_list.rb (1)
  • initialize (9-15)
lib/appwrite/models/backup_restoration_list.rb (2)
lib/appwrite/models/backup_archive_list.rb (4)
  • attr_reader (5-30)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/models/backup_policy_list.rb (4)
  • attr_reader (5-30)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/models/file.rb (1)
lib/appwrite/models/bucket.rb (1)
  • attr_reader (5-90)
lib/appwrite/models/backup_restoration.rb (8)
lib/appwrite/models/backup_archive.rb (3)
  • initialize (19-45)
  • from (47-62)
  • to_map (64-79)
lib/appwrite/models/backup_archive_list.rb (3)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/models/backup_policy.rb (3)
  • initialize (18-42)
  • from (44-58)
  • to_map (60-74)
lib/appwrite/models/backup_policy_list.rb (3)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/models/backup_restoration_list.rb (3)
  • initialize (9-15)
  • from (17-22)
  • to_map (24-29)
lib/appwrite/models/database.rb (3)
  • initialize (15-33)
  • from (35-46)
  • to_map (48-59)
lib/appwrite/models/estimation_delete_organization.rb (3)
  • initialize (8-12)
  • from (14-18)
  • to_map (20-24)
lib/appwrite/models/usage_resources.rb (2)
  • from (29-38)
  • to_map (40-49)
🪛 LanguageTool
README.md

[style] ~11-~11: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help ...

(EN_WEAK_ADJECTIVE)


[grammar] ~11-~11: Use a hyphen to join words.
Context: ...e development tasks behind a very simple to use REST API. Appwrite aims to help y...

(QB_NEW_EN_HYPHEN)


[grammar] ~11-~11: Use a hyphen to join words.
Context: ...evelopment tasks behind a very simple to use REST API. Appwrite aims to help you ...

(QB_NEW_EN_HYPHEN)

🪛 markdownlint-cli2 (0.18.1)
docs/examples/tablesdb/update-row.md

20-20: Bare URL used

(MD034, no-bare-urls)

docs/examples/databases/update-documents.md

17-17: Bare URL used

(MD034, no-bare-urls)

CHANGELOG.md

6-6: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


7-7: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


8-8: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


9-9: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

🪛 RuboCop (1.82.1)
lib/appwrite/models/database.rb

[convention] 15-24: Avoid parameter lists longer than 5 parameters. [8/5]

(Metrics/ParameterLists)

lib/appwrite/models/backup_archive.rb

[convention] 19-32: Avoid parameter lists longer than 5 parameters. [12/5]

(Metrics/ParameterLists)

lib/appwrite/models/usage_resources.rb

[convention] 13-20: Avoid parameter lists longer than 5 parameters. [6/5]

(Metrics/ParameterLists)

lib/appwrite/models/backup_policy.rb

[convention] 18-30: Avoid parameter lists longer than 5 parameters. [11/5]

(Metrics/ParameterLists)

lib/appwrite/services/backups.rb

[warning] 6-8: Call super to initialize state of the parent class.

(Lint/MissingSuper)


[convention] 117-117: Avoid comma after the last parameter of a method call.

(Style/TrailingCommaInArguments)


[convention] 156-156: Avoid parameter lists longer than 5 parameters. [7/5]

(Metrics/ParameterLists)


[convention] 287-287: Avoid comma after the last parameter of a method call.

(Style/TrailingCommaInArguments)

lib/appwrite/models/invoice.rb

[convention] 29-52: Avoid parameter lists longer than 5 parameters. [22/5]

(Metrics/ParameterLists)


[convention] 77-102: Assignment Branch Condition size for from is too high. [<1, 25, 1> 25.04/23]

(Metrics/AbcSize)

lib/appwrite/models/backup_restoration.rb

[convention] 18-30: Avoid parameter lists longer than 5 parameters. [11/5]

(Metrics/ParameterLists)

lib/appwrite/services/databases.rb

[convention] 2561-2561: Avoid parameter lists longer than 5 parameters. [6/5]

(Metrics/ParameterLists)

lib/appwrite/services/organizations.rb

[warning] 6-8: Call super to initialize state of the parent class.

(Lint/MissingSuper)


[convention] 34-34: Avoid comma after the last parameter of a method call.

(Style/TrailingCommaInArguments)

🔇 Additional comments (60)
lib/appwrite/models/bucket.rb (1)

19-19: LGTM!

The total_size attribute is cleanly integrated following the established patterns in this model class. The implementation is consistent with how the same attribute is handled in the Deployment model (mapping to "totalSize" in JSON), and all touchpoints are correctly updated: accessor declaration, initializer parameter, instance variable assignment, deserialization in from, and serialization in to_map.

Also applies to: 34-35, 50-50, 67-68, 86-87

lib/appwrite/services/avatars.rb (2)

315-315: LGTM!

The documentation type annotation correctly reflects the rename from Output to ImageFormat enum, aligning with the PR objectives.


250-283: AI summary inconsistency: get_qr has no output parameter.

The AI summary incorrectly states that get_qr had its output parameter type changed from [Output] to [ImageFormat]. However, the get_qr method does not have an output parameter—its parameters are text, size, margin, and download. Only get_screenshot was updated.

docs/examples/health/get-queue-billing-team-aggregation.md (1)

13-13: Critical: Replace null with nil in Ruby code.

Ruby uses nil for null values, not null. Using null will cause a NameError at runtime.

🐛 Proposed fix
-    threshold: null # optional
+    threshold: nil # optional

Likely an incorrect or invalid review comment.

lib/appwrite/services/health.rb (5)

145-167: LGTM!

The implementation follows the established pattern in this service class. The method correctly passes the optional threshold parameter and returns Models::HealthQueue.


169-191: LGTM!

Consistent implementation with the billing project aggregation endpoint.


218-240: LGTM!

Implementation is correct. The lower default threshold (500) documented in the comment is appropriate for a priority builds queue.


476-498: LGTM!

Implementation follows the established pattern consistently.


550-572: LGTM!

Consistent implementation for the threats queue endpoint.

lib/appwrite/models/database.rb (2)

56-57: Ensure symmetry with from method for nil handling.

If the nil safety fix is applied to from(map:), the to_map method should remain consistent. The current implementation assumes @policies and @archives are always arrays, which is fine if the constructor guarantees non-nil arrays.


12-13: New attributes for policies and archives look good.

The addition of policies and archives attributes follows the existing pattern in this model class.

Regarding the RuboCop warning about parameter count (8 vs recommended 5): this is an auto-generated SDK model where the parameter list mirrors the API schema, so suppressing or ignoring this lint is reasonable.

Also applies to: 21-23, 31-32

LICENSE (1)

1-1: LGTM!

Copyright year update to 2026 is appropriate for the current year.

appwrite.gemspec (1)

4-6: LGTM!

Version bump to 20.1.1 and grammar correction ("abstracts and simplifies") are appropriate changes.

docs/examples/avatars/get-screenshot.md (1)

36-36: LGTM!

The example correctly reflects the OutputImageFormat enum rename.

lib/appwrite/client.rb (1)

18-19: LGTM!

SDK version header correctly updated to 20.1.1, consistent with the gemspec version.

lib/appwrite/enums/name.rb (1)

14-14: LGTM!

New V1_SCREENSHOTS constant follows the established naming convention and is properly positioned within the enum.

docs/examples/databases/update-documents.md (1)

15-21: Improved example with realistic data.

The populated data payload makes this example more helpful for developers compared to an empty hash. The structure and syntax are correct.

docs/examples/tablesdb/upsert-row.md (1)

18-24: Improved example with realistic data.

The populated data payload makes this example more helpful for developers. The structure and syntax are correct.

docs/examples/tablesdb/update-row.md (1)

18-24: Improved example with realistic data.

The populated data payload makes this example more helpful for developers. The structure and syntax are correct.

docs/examples/backups/delete-policy.md (1)

1-14: New example for Backups service looks good.

The example follows the established pattern used throughout the SDK documentation and correctly demonstrates the delete_policy method. The structure and syntax are correct.

docs/examples/databases/update-document.md (1)

18-24: LGTM!

The updated example with populated data fields provides clearer documentation for SDK users on how to pass data to update_document.

docs/examples/tablesdb/update-rows.md (1)

15-21: LGTM!

Consistent with other documentation updates, providing a realistic payload example for update_rows.

docs/examples/backups/list-policies.md (1)

1-14: LGTM!

Good documentation example for the new Backups service, following the established pattern for SDK examples.

lib/appwrite/services/databases.rb (1)

2561-2561: LGTM!

Making data optional for upsert_document aligns with the API spec change mentioned in the summary. The 6-parameter count flagged by RuboCop is acceptable for SDK methods that mirror API endpoints.

lib/appwrite/services/account.rb (1)

183-203: LGTM!

The addition of the optional duration parameter to create_jwt is well-documented and consistent with the Users#create_jwt implementation shown in the external snippet. The parameter correctly allows customization of JWT expiration time.

docs/examples/account/create-jwt.md (1)

12-14: LGTM!

The documentation example correctly demonstrates the new optional duration parameter for the create_jwt method.

lib/appwrite/services/storage.rb (3)

46-48: LGTM!

Documentation updates look good: the maximum file size constraint is updated to 5GB, and the typo "choosen" is corrected to "chosen".


128-130: LGTM!

Consistent documentation updates applied to update_bucket method as well.


340-343: LGTM!

The parameter descriptions for update_file have been streamlined for consistency.

lib/appwrite/models/file.rb (3)

17-18: LGTM!

New encryption and compression attributes are correctly added, maintaining consistency with the Bucket model which has the same attributes.


31-33: LGTM!

The initializer properly accepts and assigns the new parameters.

Also applies to: 46-47


62-64: LGTM!

Serialization and deserialization logic is symmetric and follows the established pattern.

Also applies to: 80-82

lib/appwrite/models/usage_resources.rb (1)

5-50: LGTM!

The new UsageResources model follows the established SDK pattern with proper attr_reader declarations, initializer, from factory method, and to_map serialization. The static analysis hint about parameter count can be safely ignored here since this is a data model following the consistent SDK-wide pattern of using keyword arguments for all attributes.

lib/appwrite/models/invoice.rb (1)

29-75: Model structure follows SDK conventions.

The static analysis hints about parameter count and ABC size can be safely ignored—this is a data transfer object following the established SDK pattern where all attributes are passed as keyword arguments. The pattern is consistent with other models in the codebase.

docs/examples/organizations/estimation-delete-organization.md (1)

1-14: LGTM!

The documentation example correctly demonstrates the usage of the new estimation_delete_organization API with proper client initialization and method invocation.

docs/examples/backups/get-policy.md (1)

1-14: LGTM!

The documentation example correctly demonstrates the usage of the get_policy API from the new Backups service.

docs/examples/backups/delete-archive.md (1)

1-14: LGTM!

The documentation example correctly demonstrates the usage of the delete_archive API from the Backups service.

lib/appwrite/services/organizations.rb (1)

6-8: [rewritten comment]
[classification tag]

docs/examples/backups/get-restoration.md (1)

1-14: LGTM!

The documentation example is well-structured and follows the standard Appwrite SDK initialization pattern. The get_restoration call with the keyword argument is consistent with the SDK's API design.

docs/examples/backups/get-archive.md (1)

1-14: LGTM!

The documentation example correctly demonstrates the get_archive API call with proper client initialization and parameter usage.

README.md (2)

4-4: LGTM!

Version badge appropriately updated to reflect the new SDK version.


11-11: LGTM!

Good grammar correction - "abstracts and simplifies" now correctly agrees with the singular subject "Appwrite".

lib/appwrite/models/backup_policy_list.rb (1)

5-30: LGTM!

The BackupPolicyList model is well-structured and follows the established pattern used by other list models in the SDK (e.g., BackupArchiveList). The from and to_map methods correctly handle the serialization/deserialization of the policies array using BackupPolicy.from.

docs/examples/backups/list-archives.md (1)

1-14: LGTM! Documentation example is clear and correct.

The example demonstrates the basic usage pattern for listing backup archives. The empty queries array is appropriate for a minimal example.

docs/examples/backups/list-restorations.md (1)

1-14: LGTM! Documentation example follows consistent patterns.

The example correctly demonstrates how to list backup restorations using the new Backups API.

docs/examples/backups/update-policy.md (1)

1-17: LGTM!

The documentation example is clear and follows the established SDK example patterns. It properly demonstrates the update_policy method with required and optional parameters, consistent with the newly introduced Backups service.

CHANGELOG.md (1)

3-9: LGTM!

The changelog entry accurately documents the SDK updates including the breaking change rename from Output to ImageFormat, and the introduction of the Backups and Organization modules. The nested list formatting follows the existing style in this file.

lib/appwrite/models/backup_restoration_list.rb (1)

5-30: LGTM!

The BackupRestorationList model follows the established SDK pattern consistently with BackupPolicyList and BackupArchiveList. The from factory method correctly maps the nested BackupRestoration objects, and to_map properly serializes back.

lib/appwrite/models/backup_policy.rb (2)

5-42: LGTM!

The model class with 11 attributes accurately represents the backup policy entity. While RuboCop flags the parameter count, this is acceptable for SDK data models that must match the API specification. The implementation is consistent with BackupArchive and other models in this SDK.


44-74: LGTM!

The from and to_map methods correctly handle the API field naming conventions (e.g., $id, $createdAt, resourceId) and maintain consistency with other models in the SDK.

lib/appwrite/models/backup_archive_list.rb (1)

5-30: LGTM!

The BackupArchiveList model follows the established SDK pattern consistently with BackupPolicyList and BackupRestorationList. The implementation is correct and properly handles nested BackupArchive mapping.

lib/appwrite/models/backup_restoration.rb (1)

1-77: LGTM!

The BackupRestoration model follows the established pattern of other backup models in this SDK (BackupPolicy, BackupArchive). The structure is consistent with self.from(map:) for deserialization and to_map for serialization. The long parameter list is acceptable here as it mirrors the API response structure and matches the convention used throughout this auto-generated SDK.

lib/appwrite.rb (3)

138-146: LGTM!

The new model requires are properly grouped with existing model imports and follow the established pattern.


156-156: LGTM!

The enum rename from output to image_format is properly reflected here, aligning with the PR objective.


188-195: LGTM!

The new Backups and Organizations service requires are properly placed within the services section, maintaining alphabetical ordering.

lib/appwrite/models/backup_archive.rb (1)

1-82: LGTM overall!

The BackupArchive model correctly implements the established SDK pattern with self.from(map:) for deserialization and to_map for serialization. The attribute mapping aligns with the Appwrite API conventions (e.g., $id, $createdAt, camelCase keys).

lib/appwrite/services/backups.rb (4)

40-63: LGTM!

The create_archive method correctly validates services before use. The request structure and response type mapping are properly implemented.


156-196: LGTM!

The create_policy method correctly validates all required parameters (policy_id, services, retention, schedule) before constructing the API request. The long parameter list is acceptable as it mirrors the API specification.


299-328: LGTM!

The create_restoration method correctly validates required parameters before use and properly constructs the restoration request.


6-8: Omitting super is intentional and consistent across the SDK.

The parent Service class initializes the same way (@client = client), and all services uniformly follow this pattern without calling super. Since the parent and child initialization logic is identical, calling super would be redundant. This is an established pattern throughout the SDK and can be safely ignored.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

health = Health.new(client)

result = health.get_queue_billing_project_aggregation(
threshold: null # optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Replace null with nil in Ruby code.

Ruby uses nil for null values, not null. Using null will cause a NameError at runtime.

🐛 Proposed fix
-    threshold: null # optional
+    threshold: nil # optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
threshold: null # optional
threshold: nil # optional
🤖 Prompt for AI Agents
In `@docs/examples/health/get-queue-billing-project-aggregation.md` at line 13,
The YAML example sets the Ruby value incorrectly as "threshold: null"; change
this to "threshold: nil" so Ruby will use its nil object instead of an undefined
constant — update the "threshold" key in the example snippet accordingly.

health = Health.new(client)

result = health.get_queue_priority_builds(
threshold: null # optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Replace null with nil in Ruby code.

Ruby uses nil for null values, not null. Using null will cause a NameError at runtime.

🐛 Proposed fix
-    threshold: null # optional
+    threshold: nil # optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
threshold: null # optional
threshold: nil # optional
🤖 Prompt for AI Agents
In `@docs/examples/health/get-queue-priority-builds.md` at line 13, The YAML
example sets "threshold: null" which is incorrect for Ruby contexts; change the
value to "threshold: nil" so Ruby code uses the proper nil literal instead of
the undefined null (replace the "threshold: null" line with "threshold: nil" in
the example).

health = Health.new(client)

result = health.get_queue_region_manager(
threshold: null # optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Replace null with nil in Ruby code.

Ruby uses nil for null values, not null. Using null will cause a NameError at runtime.

🐛 Proposed fix
-    threshold: null # optional
+    threshold: nil # optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
threshold: null # optional
threshold: nil # optional
🤖 Prompt for AI Agents
In `@docs/examples/health/get-queue-region-manager.md` at line 13, The YAML
example sets threshold: null which is invalid in Ruby examples; change the value
from null to nil so the Ruby code uses nil for the threshold field (update the
"threshold" entry in the example to use nil).

health = Health.new(client)

result = health.get_queue_threats(
threshold: null # optional
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Critical: Replace null with nil in Ruby code.

Ruby uses nil for null values, not null. Using null will cause a NameError at runtime.

🐛 Proposed fix
-    threshold: null # optional
+    threshold: nil # optional
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
threshold: null # optional
threshold: nil # optional
🤖 Prompt for AI Agents
In `@docs/examples/health/get-queue-threats.md` at line 13, Replace the invalid
Ruby literal by changing the YAML example's threshold value from null to Ruby's
nil (i.e., update the "threshold: null" line to "threshold: nil") so the Ruby
example uses the correct nil value and avoids a NameError at runtime.

@@ -0,0 +1,32 @@
#frozen_string_literal: true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the frozen_string_literal pragma syntax.

The magic comment is missing a space after #, which may prevent Ruby from recognizing it as a valid pragma.

Suggested fix
-#frozen_string_literal: true
+# frozen_string_literal: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#frozen_string_literal: true
# frozen_string_literal: true
🤖 Prompt for AI Agents
In `@lib/appwrite/models/backup_policy_list.rb` at line 1, Update the magic
comment at the top of lib/appwrite/models/backup_policy_list.rb so Ruby
recognizes the pragma: change "#frozen_string_literal: true" to include a space
after the hash, i.e. "# frozen_string_literal: true". Ensure this corrected
comment appears as the first line of the file.

Comment on lines +268 to +274
def delete_policy(policy_id:)
api_path = '/backups/policies/{policyId}'
.gsub('{policyId}', policy_id)

if policy_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "policyId"')
end
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Same validation order issue in delete_policy.

🐛 Proposed fix
 def delete_policy(policy_id:)
+    if policy_id.nil?
+      raise Appwrite::Exception.new('Missing required parameter: "policyId"')
+    end
+
     api_path = '/backups/policies/{policyId}'
         .gsub('{policyId}', policy_id)

-    if policy_id.nil?
-      raise Appwrite::Exception.new('Missing required parameter: "policyId"')
-    end
-
     api_params = {
🤖 Prompt for AI Agents
In `@lib/appwrite/services/backups.rb` around lines 268 - 274, In delete_policy,
the code constructs api_path by calling .gsub with policy_id before validating
it; move the nil check for policy_id so it runs before building api_path (i.e.,
validate policy_id and raise Appwrite::Exception if nil at the start of
delete_policy), then construct api_path using the now-validated policy_id.

Comment on lines +359 to +365
def get_restoration(restoration_id:)
api_path = '/backups/restorations/{restorationId}'
.gsub('{restorationId}', restoration_id)

if restoration_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "restorationId"')
end
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Same validation order issue in get_restoration.

🐛 Proposed fix
 def get_restoration(restoration_id:)
+    if restoration_id.nil?
+      raise Appwrite::Exception.new('Missing required parameter: "restorationId"')
+    end
+
     api_path = '/backups/restorations/{restorationId}'
         .gsub('{restorationId}', restoration_id)

-    if restoration_id.nil?
-      raise Appwrite::Exception.new('Missing required parameter: "restorationId"')
-    end
-
     api_params = {
🤖 Prompt for AI Agents
In `@lib/appwrite/services/backups.rb` around lines 359 - 365, In get_restoration,
validate restoration_id before using it to build api_path to avoid calling .gsub
on nil; move the nil check (raise Appwrite::Exception.new('Missing required
parameter: "restorationId"')) above the api_path assignment so restoration_id is
verified first.

@@ -0,0 +1,68 @@
#frozen_string_literal: true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Malformed magic comment.

Same issue as in the model file - missing space after #.

Proposed fix
-#frozen_string_literal: true
+# frozen_string_literal: true
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#frozen_string_literal: true
# frozen_string_literal: true
🤖 Prompt for AI Agents
In `@lib/appwrite/services/organizations.rb` at line 1, The file has a malformed
magic comment "#frozen_string_literal: true" at the top; fix it by adding the
required space after the hash so it reads "# frozen_string_literal: true"
(mirror the same fix applied in the model file) to comply with Ruby magic
comment formatting.

Comment on lines +15 to +21
def delete(organization_id:)
api_path = '/organizations/{organizationId}'
.gsub('{organizationId}', organization_id)

if organization_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
end
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Nil check occurs after the value is already used.

The organization_id is substituted into the path on lines 16-17 before the nil check on lines 19-21. If organization_id is nil, Ruby will call .gsub with nil, raising TypeError: no implicit conversion of nil into String instead of the intended exception message.

Move the validation before the path substitution.

Proposed fix
 def delete(organization_id:)
+    if organization_id.nil?
+      raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
+    end
+
     api_path = '/organizations/{organizationId}'
         .gsub('{organizationId}', organization_id)
-
-    if organization_id.nil?
-      raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
-    end
🤖 Prompt for AI Agents
In `@lib/appwrite/services/organizations.rb` around lines 15 - 21, In the delete
method the nil check for organization_id happens after using it in the api_path
substitution causing a TypeError; move the validation so the method raises
Appwrite::Exception.new('Missing required parameter: "organizationId"') if
organization_id.nil? before constructing api_path (the
'/organizations/{organizationId}'.gsub(...) call) so substitution only runs on a
validated non-nil organization_id.

Comment on lines +43 to +49
def estimation_delete_organization(organization_id:)
api_path = '/organizations/{organizationId}/estimations/delete-organization'
.gsub('{organizationId}', organization_id)

if organization_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
end
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Same nil-check ordering issue.

The validation should occur before path substitution to provide a clear error message.

Proposed fix
 def estimation_delete_organization(organization_id:)
+    if organization_id.nil?
+      raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
+    end
+
     api_path = '/organizations/{organizationId}/estimations/delete-organization'
         .gsub('{organizationId}', organization_id)
-
-    if organization_id.nil?
-      raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
-    end
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def estimation_delete_organization(organization_id:)
api_path = '/organizations/{organizationId}/estimations/delete-organization'
.gsub('{organizationId}', organization_id)
if organization_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
end
def estimation_delete_organization(organization_id:)
if organization_id.nil?
raise Appwrite::Exception.new('Missing required parameter: "organizationId"')
end
api_path = '/organizations/{organizationId}/estimations/delete-organization'
.gsub('{organizationId}', organization_id)
🤖 Prompt for AI Agents
In `@lib/appwrite/services/organizations.rb` around lines 43 - 49, In
estimation_delete_organization, perform the nil-check for organization_id before
constructing api_path (i.e., before calling .gsub('{organizationId}',
organization_id)); if organization_id is nil raise
Appwrite::Exception.new('Missing required parameter: "organizationId"') first,
then build api_path using .gsub('{organizationId}', organization_id) so the
error message is clear and substitution never runs with a nil value.

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