-
Notifications
You must be signed in to change notification settings - Fork 8
Updates: sync as per latest cloud specs #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThis 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 Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this 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: Theget_columnmethod hardcodes response type toModels::ColumnBoolean, preventing retrieval of other column types.This method accepts a generic
keyparameter 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 asColumnBoolean, causing incorrect type casting for string, datetime, integer, and other column types.Users cannot retrieve non-boolean columns using this method. Either:
- Remove the
response_typeparameter to return raw response data- Add a type parameter to
get_columnand conditionally set the response type based on the actual column's type attribute- 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
@deprecatedsince 1.8.0 (line 2073) with a directive to useTablesDB.getColumninstead. 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::AttributeBooleanresponse type is incorrect for a generic attribute getter that can retrieve attributes of any type (String, Integer, Float, Datetime, Enum, etc.). Either remove theresponse_typeparameter 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" => falsedocs/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 withREADME.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
servicesarray 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
servicesarray 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: truelib/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: truewith a space after#.Suggested fix
-#frozen_string_literal: true +# frozen_string_literal: truelib/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: truelib/appwrite/models/backup_archive.rb (1)
30-31: Minor formatting inconsistency.The trailing spaces after
resource_id:andresource_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
📒 Files selected for processing (58)
CHANGELOG.mdLICENSEREADME.mdappwrite.gemspecdocs/examples/account/create-jwt.mddocs/examples/avatars/get-screenshot.mddocs/examples/backups/create-archive.mddocs/examples/backups/create-policy.mddocs/examples/backups/create-restoration.mddocs/examples/backups/delete-archive.mddocs/examples/backups/delete-policy.mddocs/examples/backups/get-archive.mddocs/examples/backups/get-policy.mddocs/examples/backups/get-restoration.mddocs/examples/backups/list-archives.mddocs/examples/backups/list-policies.mddocs/examples/backups/list-restorations.mddocs/examples/backups/update-policy.mddocs/examples/databases/update-document.mddocs/examples/databases/update-documents.mddocs/examples/databases/upsert-document.mddocs/examples/health/get-queue-billing-project-aggregation.mddocs/examples/health/get-queue-billing-team-aggregation.mddocs/examples/health/get-queue-priority-builds.mddocs/examples/health/get-queue-region-manager.mddocs/examples/health/get-queue-threats.mddocs/examples/organizations/delete.mddocs/examples/organizations/estimation-delete-organization.mddocs/examples/tablesdb/update-row.mddocs/examples/tablesdb/update-rows.mddocs/examples/tablesdb/upsert-row.mdlib/appwrite.rblib/appwrite/client.rblib/appwrite/enums/build_runtime.rblib/appwrite/enums/name.rblib/appwrite/enums/o_auth_provider.rblib/appwrite/enums/output.rblib/appwrite/enums/runtime.rblib/appwrite/models/backup_archive.rblib/appwrite/models/backup_archive_list.rblib/appwrite/models/backup_policy.rblib/appwrite/models/backup_policy_list.rblib/appwrite/models/backup_restoration.rblib/appwrite/models/backup_restoration_list.rblib/appwrite/models/bucket.rblib/appwrite/models/database.rblib/appwrite/models/estimation_delete_organization.rblib/appwrite/models/file.rblib/appwrite/models/invoice.rblib/appwrite/models/usage_resources.rblib/appwrite/services/account.rblib/appwrite/services/avatars.rblib/appwrite/services/backups.rblib/appwrite/services/databases.rblib/appwrite/services/health.rblib/appwrite/services/organizations.rblib/appwrite/services/storage.rblib/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_sizeattribute is cleanly integrated following the established patterns in this model class. The implementation is consistent with how the same attribute is handled in theDeploymentmodel (mapping to"totalSize"in JSON), and all touchpoints are correctly updated: accessor declaration, initializer parameter, instance variable assignment, deserialization infrom, and serialization into_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
OutputtoImageFormatenum, aligning with the PR objectives.
250-283: AI summary inconsistency:get_qrhas nooutputparameter.The AI summary incorrectly states that
get_qrhad its output parameter type changed from[Output]to[ImageFormat]. However, theget_qrmethod does not have anoutputparameter—its parameters aretext,size,margin, anddownload. Onlyget_screenshotwas updated.docs/examples/health/get-queue-billing-team-aggregation.md (1)
13-13: Critical: Replacenullwithnilin Ruby code.Ruby uses
nilfor null values, notnull. Usingnullwill cause aNameErrorat runtime.🐛 Proposed fix
- threshold: null # optional + threshold: nil # optionalLikely 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
thresholdparameter and returnsModels::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 withfrommethod for nil handling.If the nil safety fix is applied to
from(map:), theto_mapmethod should remain consistent. The current implementation assumes@policiesand@archivesare 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
policiesandarchivesattributes 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
Output→ImageFormatenum 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_SCREENSHOTSconstant 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
dataoptional forupsert_documentaligns 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
durationparameter tocreate_jwtis well-documented and consistent with theUsers#create_jwtimplementation 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
durationparameter for thecreate_jwtmethod.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_bucketmethod as well.
340-343: LGTM!The parameter descriptions for
update_filehave been streamlined for consistency.lib/appwrite/models/file.rb (3)
17-18: LGTM!New
encryptionandcompressionattributes are correctly added, maintaining consistency with theBucketmodel 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
UsageResourcesmodel follows the established SDK pattern with properattr_readerdeclarations, initializer,fromfactory method, andto_mapserialization. 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_organizationAPI 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_policyAPI 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_archiveAPI 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_restorationcall 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_archiveAPI 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
BackupPolicyListmodel is well-structured and follows the established pattern used by other list models in the SDK (e.g.,BackupArchiveList). Thefromandto_mapmethods correctly handle the serialization/deserialization of the policies array usingBackupPolicy.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_policymethod 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
OutputtoImageFormat, 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
BackupRestorationListmodel follows the established SDK pattern consistently withBackupPolicyListandBackupArchiveList. Thefromfactory method correctly maps the nestedBackupRestorationobjects, andto_mapproperly 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
BackupArchiveand other models in this SDK.
44-74: LGTM!The
fromandto_mapmethods 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
BackupArchiveListmodel follows the established SDK pattern consistently withBackupPolicyListandBackupRestorationList. The implementation is correct and properly handles nestedBackupArchivemapping.lib/appwrite/models/backup_restoration.rb (1)
1-77: LGTM!The
BackupRestorationmodel follows the established pattern of other backup models in this SDK (BackupPolicy,BackupArchive). The structure is consistent withself.from(map:)for deserialization andto_mapfor 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
outputtoimage_formatis properly reflected here, aligning with the PR objective.
188-195: LGTM!The new
BackupsandOrganizationsservice requires are properly placed within the services section, maintaining alphabetical ordering.lib/appwrite/models/backup_archive.rb (1)
1-82: LGTM overall!The
BackupArchivemodel correctly implements the established SDK pattern withself.from(map:)for deserialization andto_mapfor 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_archivemethod correctly validatesservicesbefore use. The request structure and response type mapping are properly implemented.
156-196: LGTM!The
create_policymethod 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_restorationmethod correctly validates required parameters before use and properly constructs the restoration request.
6-8: Omittingsuperis intentional and consistent across the SDK.The parent
Serviceclass initializes the same way (@client = client), and all services uniformly follow this pattern without callingsuper. Since the parent and child initialization logic is identical, callingsuperwould 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| #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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| #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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
What does this PR do?
Changes as per latest server specs, these include -
Outputis now correctly renamed toImageFormatTest 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
Outputenum renamed toImageFormatNew Features
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.