From 28ca89690a1c0a3e20bab098404fedaffe530baa Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 3 Nov 2025 16:30:38 +1300 Subject: [PATCH 1/2] Add operators --- CHANGELOG.md | 5 + appwrite.gemspec | 2 +- docs/examples/account/list-identities.md | 3 +- docs/examples/account/list-logs.md | 3 +- docs/examples/databases/create-collection.md | 4 +- docs/examples/databases/create-document.md | 4 +- docs/examples/databases/list-attributes.md | 3 +- docs/examples/databases/list-collections.md | 3 +- docs/examples/databases/list-documents.md | 3 +- docs/examples/databases/list-indexes.md | 3 +- docs/examples/databases/list.md | 3 +- docs/examples/databases/update-collection.md | 4 +- docs/examples/databases/update-document.md | 4 +- docs/examples/databases/upsert-document.md | 4 +- docs/examples/functions/list-deployments.md | 3 +- docs/examples/functions/list-executions.md | 3 +- docs/examples/functions/list.md | 3 +- .../messaging/create-resend-provider.md | 21 +++ docs/examples/messaging/list-message-logs.md | 3 +- docs/examples/messaging/list-messages.md | 3 +- docs/examples/messaging/list-provider-logs.md | 3 +- docs/examples/messaging/list-providers.md | 3 +- .../messaging/list-subscriber-logs.md | 3 +- docs/examples/messaging/list-subscribers.md | 3 +- docs/examples/messaging/list-targets.md | 3 +- docs/examples/messaging/list-topic-logs.md | 3 +- docs/examples/messaging/list-topics.md | 3 +- .../messaging/update-resend-provider.md | 21 +++ docs/examples/sites/list-deployments.md | 3 +- docs/examples/sites/list-logs.md | 3 +- docs/examples/sites/list.md | 3 +- docs/examples/storage/create-bucket.md | 4 +- docs/examples/storage/create-file.md | 4 +- docs/examples/storage/list-buckets.md | 3 +- docs/examples/storage/list-files.md | 3 +- docs/examples/storage/update-bucket.md | 4 +- docs/examples/storage/update-file.md | 4 +- docs/examples/tablesdb/create-row.md | 4 +- docs/examples/tablesdb/create-table.md | 4 +- docs/examples/tablesdb/list-columns.md | 3 +- docs/examples/tablesdb/list-indexes.md | 3 +- docs/examples/tablesdb/list-rows.md | 3 +- docs/examples/tablesdb/list-tables.md | 3 +- docs/examples/tablesdb/list.md | 3 +- docs/examples/tablesdb/update-row.md | 4 +- docs/examples/tablesdb/update-table.md | 4 +- docs/examples/tablesdb/upsert-row.md | 4 +- docs/examples/teams/list-memberships.md | 3 +- docs/examples/teams/list.md | 3 +- docs/examples/tokens/list.md | 3 +- docs/examples/users/list-identities.md | 3 +- docs/examples/users/list-logs.md | 3 +- docs/examples/users/list-memberships.md | 3 +- docs/examples/users/list-sessions.md | 3 +- docs/examples/users/list-targets.md | 3 +- docs/examples/users/list.md | 3 +- lib/appwrite.rb | 11 ++ lib/appwrite/client.rb | 2 +- lib/appwrite/enums/execution_status.rb | 1 + lib/appwrite/enums/framework.rb | 1 + lib/appwrite/models/execution.rb | 1 + lib/appwrite/operator.rb | 145 ++++++++++++++++++ lib/appwrite/query.rb | 12 +- lib/appwrite/services/account.rb | 8 +- lib/appwrite/services/databases.rb | 20 ++- lib/appwrite/services/functions.rb | 12 +- lib/appwrite/services/messaging.rb | 126 +++++++++++++-- lib/appwrite/services/sites.rb | 12 +- lib/appwrite/services/storage.rb | 8 +- lib/appwrite/services/tables_db.rb | 20 ++- lib/appwrite/services/teams.rb | 8 +- lib/appwrite/services/tokens.rb | 4 +- lib/appwrite/services/users.rb | 24 ++- 73 files changed, 536 insertions(+), 98 deletions(-) create mode 100644 docs/examples/messaging/create-resend-provider.md create mode 100644 docs/examples/messaging/update-resend-provider.md create mode 100644 lib/appwrite/operator.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 22f70c4..80a69b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 19.3.0 + +* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance +* Add `Operator` class for atomic modification of rows via update, bulk update, upsert, and bulk upsert operations + ## 19.2.1 * Add transaction support for Databases and TablesDB diff --git a/appwrite.gemspec b/appwrite.gemspec index 6f72f0f..2ccee57 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '19.2.1' + spec.version = '19.3.0' spec.license = 'BSD-3-Clause' spec.summary = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API' spec.author = 'Appwrite Team' diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 696e02d..9935d08 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -10,5 +10,6 @@ client = Client.new account = Account.new(client) result = account.list_identities( - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index 1f3366a..d31eae7 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -10,5 +10,6 @@ client = Client.new account = Account.new(client) result = account.list_logs( - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index c22b348..178b5a5 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,7 +15,7 @@ result = databases.create_collection( database_id: '', collection_id: '', name: '', - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional document_security: false, # optional enabled: false # optional ) diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index d12a3db..c29c5d2 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -20,6 +22,6 @@ result = databases.create_document( "age" => 30, "isAdmin" => false }, - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional transaction_id: '' # optional ) diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index f1ec0de..8125225 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -12,5 +12,6 @@ databases = Databases.new(client) result = databases.list_attributes( database_id: '', collection_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 26f3d35..46b7d8d 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -12,5 +12,6 @@ databases = Databases.new(client) result = databases.list_collections( database_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index 666bfbd..f559d9f 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -13,5 +13,6 @@ result = databases.list_documents( database_id: '', collection_id: '', queries: [], # optional - transaction_id: '' # optional + transaction_id: '', # optional + total: false # optional ) diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index f98c62a..4527d40 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -12,5 +12,6 @@ databases = Databases.new(client) result = databases.list_indexes( database_id: '', collection_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 2e093f7..8cd03d7 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -11,5 +11,6 @@ databases = Databases.new(client) result = databases.list( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index d42a651..6928b9a 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,7 +15,7 @@ result = databases.update_collection( database_id: '', collection_id: '', name: '', - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional document_security: false, # optional enabled: false # optional ) diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 5831d68..5a1eb56 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -14,6 +16,6 @@ result = databases.update_document( collection_id: '', document_id: '', data: {}, # optional - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional transaction_id: '' # optional ) diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index e5daa55..fa2f1cd 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -14,6 +16,6 @@ result = databases.upsert_document( collection_id: '', document_id: '', data: {}, - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional transaction_id: '' # optional ) diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 3df3dd3..0b6bcf1 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -12,5 +12,6 @@ functions = Functions.new(client) result = functions.list_deployments( function_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 57b4ba2..5b0f1f2 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -11,5 +11,6 @@ functions = Functions.new(client) result = functions.list_executions( function_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index 0cab1c3..ea008ef 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -11,5 +11,6 @@ functions = Functions.new(client) result = functions.list( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md new file mode 100644 index 0000000..73c969b --- /dev/null +++ b/docs/examples/messaging/create-resend-provider.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.create_resend_provider( + provider_id: '', + name: '', + api_key: '', # optional + from_name: '', # optional + from_email: 'email@example.com', # optional + reply_to_name: '', # optional + reply_to_email: 'email@example.com', # optional + enabled: false # optional +) diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index f20d6fb..a0f1f38 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_message_logs( message_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index ffc5dcd..5e9b9f1 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_messages( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index af3751a..fe01a71 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_provider_logs( provider_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index a857f05..1207473 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_providers( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 06550e7..492e0d9 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_subscriber_logs( subscriber_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index 07ebc99..75182c1 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -12,5 +12,6 @@ messaging = Messaging.new(client) result = messaging.list_subscribers( topic_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index 0407255..6b4473e 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_targets( message_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 9b53c47..a22976f 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_topic_logs( topic_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index 5e7b674..4e60a73 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -11,5 +11,6 @@ messaging = Messaging.new(client) result = messaging.list_topics( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md new file mode 100644 index 0000000..cb72b5c --- /dev/null +++ b/docs/examples/messaging/update-resend-provider.md @@ -0,0 +1,21 @@ +require 'appwrite' + +include Appwrite + +client = Client.new + .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint + .set_project('') # Your project ID + .set_key('') # Your secret API key + +messaging = Messaging.new(client) + +result = messaging.update_resend_provider( + provider_id: '', + name: '', # optional + enabled: false, # optional + api_key: '', # optional + from_name: '', # optional + from_email: 'email@example.com', # optional + reply_to_name: '', # optional + reply_to_email: '' # optional +) diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 8571f85..d673f4a 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -12,5 +12,6 @@ sites = Sites.new(client) result = sites.list_deployments( site_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 919be96..9cba113 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -11,5 +11,6 @@ sites = Sites.new(client) result = sites.list_logs( site_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index ba70205..f25201e 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -11,5 +11,6 @@ sites = Sites.new(client) result = sites.list( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 643431e..4a12518 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +14,7 @@ storage = Storage.new(client) result = storage.create_bucket( bucket_id: '', name: '', - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional file_security: false, # optional enabled: false, # optional maximum_file_size: 1, # optional diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 99e07c3..8e045da 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,5 +15,5 @@ result = storage.create_file( bucket_id: '', file_id: '', file: InputFile.from_path('dir/file.png'), - permissions: ["read("any")"] # optional + permissions: [Permission.read(Role.any())] # optional ) diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index dfee831..a73443f 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -11,5 +11,6 @@ storage = Storage.new(client) result = storage.list_buckets( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index 078ff55..0223e51 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -12,5 +12,6 @@ storage = Storage.new(client) result = storage.list_files( bucket_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 09b915e..2e44aad 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -12,7 +14,7 @@ storage = Storage.new(client) result = storage.update_bucket( bucket_id: '', name: '', - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional file_security: false, # optional enabled: false, # optional maximum_file_size: 1, # optional diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index a454499..4aeb1c7 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,5 +15,5 @@ result = storage.update_file( bucket_id: '', file_id: '', name: '', # optional - permissions: ["read("any")"] # optional + permissions: [Permission.read(Role.any())] # optional ) diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 5622711..a67b821 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -20,6 +22,6 @@ result = tables_db.create_row( "age" => 30, "isAdmin" => false }, - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional transaction_id: '' # optional ) diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index c8fcf47..6a1a0e9 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,7 +15,7 @@ result = tables_db.create_table( database_id: '', table_id: '', name: '', - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional row_security: false, # optional enabled: false # optional ) diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index f3f0165..bc6e10c 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client) result = tables_db.list_columns( database_id: '', table_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 85e343f..9e03d7a 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client) result = tables_db.list_indexes( database_id: '', table_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index b205cec..771894a 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -13,5 +13,6 @@ result = tables_db.list_rows( database_id: '', table_id: '', queries: [], # optional - transaction_id: '' # optional + transaction_id: '', # optional + total: false # optional ) diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index a2ec4cd..49205b2 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -12,5 +12,6 @@ tables_db = TablesDB.new(client) result = tables_db.list_tables( database_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index ca0d464..1531ab2 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -11,5 +11,6 @@ tables_db = TablesDB.new(client) result = tables_db.list( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 0212305..fc6fca6 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -14,6 +16,6 @@ result = tables_db.update_row( table_id: '', row_id: '', data: {}, # optional - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional transaction_id: '' # optional ) diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index cb8706d..5385e00 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -13,7 +15,7 @@ result = tables_db.update_table( database_id: '', table_id: '', name: '', - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional row_security: false, # optional enabled: false # optional ) diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 9feb685..6201834 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -1,6 +1,8 @@ require 'appwrite' include Appwrite +include Appwrite::Permission +include Appwrite::Role client = Client.new .set_endpoint('https://.cloud.appwrite.io/v1') # Your API Endpoint @@ -14,6 +16,6 @@ result = tables_db.upsert_row( table_id: '', row_id: '', data: {}, # optional - permissions: ["read("any")"], # optional + permissions: [Permission.read(Role.any())], # optional transaction_id: '' # optional ) diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index db48f0c..b8d947c 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -12,5 +12,6 @@ teams = Teams.new(client) result = teams.list_memberships( team_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 9e96391..863162c 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -11,5 +11,6 @@ teams = Teams.new(client) result = teams.list( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index 4932f04..a928828 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -12,5 +12,6 @@ tokens = Tokens.new(client) result = tokens.list( bucket_id: '', file_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 78c8cf5..3f147d7 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -11,5 +11,6 @@ users = Users.new(client) result = users.list_identities( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index 6864348..a33f8fe 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -11,5 +11,6 @@ users = Users.new(client) result = users.list_logs( user_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index a4c3aa1..0ca37bf 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -12,5 +12,6 @@ users = Users.new(client) result = users.list_memberships( user_id: '', queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 3114205..695d99b 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -10,5 +10,6 @@ client = Client.new users = Users.new(client) result = users.list_sessions( - user_id: '' + user_id: '', + total: false # optional ) diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index aae9941..4034d72 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -11,5 +11,6 @@ users = Users.new(client) result = users.list_targets( user_id: '', - queries: [] # optional + queries: [], # optional + total: false # optional ) diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index b490b65..63c317a 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -11,5 +11,6 @@ users = Users.new(client) result = users.list( queries: [], # optional - search: '' # optional + search: '', # optional + total: false # optional ) diff --git a/lib/appwrite.rb b/lib/appwrite.rb index e47781c..096946a 100644 --- a/lib/appwrite.rb +++ b/lib/appwrite.rb @@ -11,6 +11,7 @@ require_relative 'appwrite/permission' require_relative 'appwrite/role' require_relative 'appwrite/id' +require_relative 'appwrite/operator' require_relative 'appwrite/models/row_list' require_relative 'appwrite/models/document_list' @@ -159,6 +160,16 @@ require_relative 'appwrite/enums/image_format' require_relative 'appwrite/enums/password_hash' require_relative 'appwrite/enums/messaging_provider_type' +require_relative 'appwrite/enums/database_type' +require_relative 'appwrite/enums/attribute_status' +require_relative 'appwrite/enums/column_status' +require_relative 'appwrite/enums/index_status' +require_relative 'appwrite/enums/deployment_status' +require_relative 'appwrite/enums/execution_trigger' +require_relative 'appwrite/enums/execution_status' +require_relative 'appwrite/enums/health_antivirus_status' +require_relative 'appwrite/enums/health_check_status' +require_relative 'appwrite/enums/message_status' require_relative 'appwrite/services/account' require_relative 'appwrite/services/avatars' diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index 443da70..7a4709d 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -15,7 +15,7 @@ def initialize 'x-sdk-name'=> 'Ruby', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'ruby', - 'x-sdk-version'=> '19.2.1', + 'x-sdk-version'=> '19.3.0', 'X-Appwrite-Response-Format' => '1.8.0' } @endpoint = 'https://cloud.appwrite.io/v1' diff --git a/lib/appwrite/enums/execution_status.rb b/lib/appwrite/enums/execution_status.rb index 02d14c7..301a6ae 100644 --- a/lib/appwrite/enums/execution_status.rb +++ b/lib/appwrite/enums/execution_status.rb @@ -5,6 +5,7 @@ module ExecutionStatus PROCESSING = 'processing' COMPLETED = 'completed' FAILED = 'failed' + SCHEDULED = 'scheduled' end end end \ No newline at end of file diff --git a/lib/appwrite/enums/framework.rb b/lib/appwrite/enums/framework.rb index 63d9c0f..b58f8cf 100644 --- a/lib/appwrite/enums/framework.rb +++ b/lib/appwrite/enums/framework.rb @@ -9,6 +9,7 @@ module Framework VUE = 'vue' SVELTEKIT = 'sveltekit' ASTRO = 'astro' + TANSTACK_START = 'tanstack-start' REMIX = 'remix' LYNX = 'lynx' FLUTTER = 'flutter' diff --git a/lib/appwrite/models/execution.rb b/lib/appwrite/models/execution.rb index 2754f77..ef56563 100644 --- a/lib/appwrite/models/execution.rb +++ b/lib/appwrite/models/execution.rb @@ -130,6 +130,7 @@ def validate_status(status) Appwrite::Enums::ExecutionStatus::PROCESSING, Appwrite::Enums::ExecutionStatus::COMPLETED, Appwrite::Enums::ExecutionStatus::FAILED, + Appwrite::Enums::ExecutionStatus::SCHEDULED, ] unless valid_status.include?(status) diff --git a/lib/appwrite/operator.rb b/lib/appwrite/operator.rb new file mode 100644 index 0000000..92ea6fa --- /dev/null +++ b/lib/appwrite/operator.rb @@ -0,0 +1,145 @@ +require 'json' + +module Appwrite + module Condition + EQUAL = "equal" + NOT_EQUAL = "notEqual" + GREATER_THAN = "greaterThan" + GREATER_THAN_EQUAL = "greaterThanEqual" + LESS_THAN = "lessThan" + LESS_THAN_EQUAL = "lessThanEqual" + CONTAINS = "contains" + IS_NULL = "isNull" + IS_NOT_NULL = "isNotNull" + end + + class Operator + def initialize(method, values = nil) + @method = method + + if values != nil + if values.is_a?(Array) + @values = values + else + @values = [values] + end + end + end + + def to_json(*args) + result = { method: @method } + result[:values] = @values unless @values.nil? + result.to_json(*args) + end + + def to_s + return self.to_json + end + + class << Operator + def increment(value = 1, max = nil) + raise ArgumentError, "Value cannot be NaN or Infinity" if value.respond_to?(:nan?) && (value.nan? || value.infinite?) + raise ArgumentError, "Max cannot be NaN or Infinity" if max != nil && max.respond_to?(:nan?) && (max.nan? || max.infinite?) + values = [value] + values << max if max != nil + return Operator.new("increment", values).to_s + end + + def decrement(value = 1, min = nil) + raise ArgumentError, "Value cannot be NaN or Infinity" if value.respond_to?(:nan?) && (value.nan? || value.infinite?) + raise ArgumentError, "Min cannot be NaN or Infinity" if min != nil && min.respond_to?(:nan?) && (min.nan? || min.infinite?) + values = [value] + values << min if min != nil + return Operator.new("decrement", values).to_s + end + + def multiply(factor, max = nil) + raise ArgumentError, "Factor cannot be NaN or Infinity" if factor.respond_to?(:nan?) && (factor.nan? || factor.infinite?) + raise ArgumentError, "Max cannot be NaN or Infinity" if max != nil && max.respond_to?(:nan?) && (max.nan? || max.infinite?) + values = [factor] + values << max if max != nil + return Operator.new("multiply", values).to_s + end + + def divide(divisor, min = nil) + raise ArgumentError, "Divisor cannot be NaN or Infinity" if divisor.respond_to?(:nan?) && (divisor.nan? || divisor.infinite?) + raise ArgumentError, "Min cannot be NaN or Infinity" if min != nil && min.respond_to?(:nan?) && (min.nan? || min.infinite?) + raise ArgumentError, "Divisor cannot be zero" if divisor == 0 || divisor == 0.0 + values = [divisor] + values << min if min != nil + return Operator.new("divide", values).to_s + end + + def modulo(divisor) + raise ArgumentError, "Divisor cannot be NaN or Infinity" if divisor.respond_to?(:nan?) && (divisor.nan? || divisor.infinite?) + raise ArgumentError, "Divisor cannot be zero" if divisor == 0 || divisor == 0.0 + return Operator.new("modulo", [divisor]).to_s + end + + def power(exponent, max = nil) + raise ArgumentError, "Exponent cannot be NaN or Infinity" if exponent.respond_to?(:nan?) && (exponent.nan? || exponent.infinite?) + raise ArgumentError, "Max cannot be NaN or Infinity" if max != nil && max.respond_to?(:nan?) && (max.nan? || max.infinite?) + values = [exponent] + values << max if max != nil + return Operator.new("power", values).to_s + end + + def array_append(values) + return Operator.new("arrayAppend", values).to_s + end + + def array_prepend(values) + return Operator.new("arrayPrepend", values).to_s + end + + def array_insert(index, value) + return Operator.new("arrayInsert", [index, value]).to_s + end + + def array_remove(value) + return Operator.new("arrayRemove", [value]).to_s + end + + def array_unique() + return Operator.new("arrayUnique", []).to_s + end + + def array_intersect(values) + return Operator.new("arrayIntersect", values).to_s + end + + def array_diff(values) + return Operator.new("arrayDiff", values).to_s + end + + def array_filter(condition, value = nil) + values = [condition, value] + return Operator.new("arrayFilter", values).to_s + end + + def string_concat(value) + return Operator.new("stringConcat", [value]).to_s + end + + def string_replace(search, replace) + return Operator.new("stringReplace", [search, replace]).to_s + end + + def toggle() + return Operator.new("toggle", []).to_s + end + + def date_add_days(days) + return Operator.new("dateAddDays", [days]).to_s + end + + def date_sub_days(days) + return Operator.new("dateSubDays", [days]).to_s + end + + def date_set_now() + return Operator.new("dateSetNow", []).to_s + end + end + end +end diff --git a/lib/appwrite/query.rb b/lib/appwrite/query.rb index 2372662..10da764 100644 --- a/lib/appwrite/query.rb +++ b/lib/appwrite/query.rb @@ -133,27 +133,27 @@ def not_ends_with(attribute, value) end def created_before(value) - return Query.new("createdBefore", nil, value).to_s + return less_than("$createdAt", value) end def created_after(value) - return Query.new("createdAfter", nil, value).to_s + return greater_than("$createdAt", value) end def created_between(start, ending) - return Query.new("createdBetween", nil, [start, ending]).to_s + return between("$createdAt", start, ending) end def updated_before(value) - return Query.new("updatedBefore", nil, value).to_s + return less_than("$updatedAt", value) end def updated_after(value) - return Query.new("updatedAfter", nil, value).to_s + return greater_than("$updatedAt", value) end def updated_between(start, ending) - return Query.new("updatedBetween", nil, [start, ending]).to_s + return between("$updatedAt", start, ending) end def or(queries) diff --git a/lib/appwrite/services/account.rb b/lib/appwrite/services/account.rb index 3640c9b..d6b9e1d 100644 --- a/lib/appwrite/services/account.rb +++ b/lib/appwrite/services/account.rb @@ -123,13 +123,15 @@ def update_email(email:, password:) # Get the list of identities for the currently logged in user. # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [IdentityList] - def list_identities(queries: nil) + def list_identities(queries: nil, total: nil) api_path = '/account/identities' api_params = { queries: queries, + total: total, } api_headers = { @@ -203,13 +205,15 @@ def create_jwt() # user. Each log returns user IP address, location and date and time of log. # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [LogList] - def list_logs(queries: nil) + def list_logs(queries: nil, total: nil) api_path = '/account/logs' api_params = { queries: queries, + total: total, } api_headers = { diff --git a/lib/appwrite/services/databases.rb b/lib/appwrite/services/databases.rb index 07b75cc..1ebbc5e 100644 --- a/lib/appwrite/services/databases.rb +++ b/lib/appwrite/services/databases.rb @@ -15,14 +15,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [DatabaseList] - def list(queries: nil, search: nil) + def list(queries: nil, search: nil, total: nil) api_path = '/databases' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -360,9 +362,10 @@ def delete(database_id:) # @param [String] database_id Database ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [CollectionList] - def list_collections(database_id:, queries: nil, search: nil) + def list_collections(database_id:, queries: nil, search: nil, total: nil) api_path = '/databases/{databaseId}/collections' .gsub('{databaseId}', database_id) @@ -373,6 +376,7 @@ def list_collections(database_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -574,9 +578,10 @@ def delete_collection(database_id:, collection_id:) # @param [String] database_id Database ID. # @param [String] collection_id Collection ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [AttributeList] - def list_attributes(database_id:, collection_id:, queries: nil) + def list_attributes(database_id:, collection_id:, queries: nil, total: nil) api_path = '/databases/{databaseId}/collections/{collectionId}/attributes' .gsub('{databaseId}', database_id) .gsub('{collectionId}', collection_id) @@ -591,6 +596,7 @@ def list_attributes(database_id:, collection_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -2204,9 +2210,10 @@ def update_relationship_attribute(database_id:, collection_id:, key:, on_delete: # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. # @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [DocumentList] - def list_documents(database_id:, collection_id:, queries: nil, transaction_id: nil) + def list_documents(database_id:, collection_id:, queries: nil, transaction_id: nil, total: nil) api_path = '/databases/{databaseId}/collections/{collectionId}/documents' .gsub('{databaseId}', database_id) .gsub('{collectionId}', collection_id) @@ -2222,6 +2229,7 @@ def list_documents(database_id:, collection_id:, queries: nil, transaction_id: n api_params = { queries: queries, transactionId: transaction_id, + total: total, } api_headers = { @@ -2802,9 +2810,10 @@ def increment_document_attribute(database_id:, collection_id:, document_id:, att # @param [String] database_id Database ID. # @param [String] collection_id Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [IndexList] - def list_indexes(database_id:, collection_id:, queries: nil) + def list_indexes(database_id:, collection_id:, queries: nil, total: nil) api_path = '/databases/{databaseId}/collections/{collectionId}/indexes' .gsub('{databaseId}', database_id) .gsub('{collectionId}', collection_id) @@ -2819,6 +2828,7 @@ def list_indexes(database_id:, collection_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index 6f163ea..b73b16e 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -12,14 +12,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [FunctionList] - def list(queries: nil, search: nil) + def list(queries: nil, search: nil, total: nil) api_path = '/functions' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -317,9 +319,10 @@ def update_function_deployment(function_id:, deployment_id:) # @param [String] function_id Function ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [DeploymentList] - def list_deployments(function_id:, queries: nil, search: nil) + def list_deployments(function_id:, queries: nil, search: nil, total: nil) api_path = '/functions/{functionId}/deployments' .gsub('{functionId}', function_id) @@ -330,6 +333,7 @@ def list_deployments(function_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -697,9 +701,10 @@ def update_deployment_status(function_id:, deployment_id:) # # @param [String] function_id Function ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [ExecutionList] - def list_executions(function_id:, queries: nil) + def list_executions(function_id:, queries: nil, total: nil) api_path = '/functions/{functionId}/executions' .gsub('{functionId}', function_id) @@ -709,6 +714,7 @@ def list_executions(function_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { diff --git a/lib/appwrite/services/messaging.rb b/lib/appwrite/services/messaging.rb index a24020b..6e12674 100644 --- a/lib/appwrite/services/messaging.rb +++ b/lib/appwrite/services/messaging.rb @@ -11,14 +11,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [MessageList] - def list_messages(queries: nil, search: nil) + def list_messages(queries: nil, search: nil, total: nil) api_path = '/messaging/messages' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -430,9 +432,10 @@ def delete(message_id:) # # @param [String] message_id Message ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [LogList] - def list_message_logs(message_id:, queries: nil) + def list_message_logs(message_id:, queries: nil, total: nil) api_path = '/messaging/messages/{messageId}/logs' .gsub('{messageId}', message_id) @@ -442,6 +445,7 @@ def list_message_logs(message_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -460,9 +464,10 @@ def list_message_logs(message_id:, queries: nil) # # @param [String] message_id Message ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [TargetList] - def list_targets(message_id:, queries: nil) + def list_targets(message_id:, queries: nil, total: nil) api_path = '/messaging/messages/{messageId}/targets' .gsub('{messageId}', message_id) @@ -472,6 +477,7 @@ def list_targets(message_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -490,14 +496,16 @@ def list_targets(message_id:, queries: nil) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [ProviderList] - def list_providers(queries: nil, search: nil) + def list_providers(queries: nil, search: nil, total: nil) api_path = '/messaging/providers' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -856,6 +864,96 @@ def update_msg91_provider(provider_id:, name: nil, enabled: nil, template_id: ni ) end + # Create a new Resend provider. + # + # @param [String] provider_id Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. + # @param [String] name Provider name. + # @param [String] api_key Resend API key. + # @param [String] from_name Sender Name. + # @param [String] from_email Sender email address. + # @param [String] reply_to_name Name set in the reply to field for the mail. Default value is sender name. + # @param [String] reply_to_email Email set in the reply to field for the mail. Default value is sender email. + # @param [] enabled Set as enabled. + # + # @return [Provider] + def create_resend_provider(provider_id:, name:, api_key: nil, from_name: nil, from_email: nil, reply_to_name: nil, reply_to_email: nil, enabled: nil) + api_path = '/messaging/providers/resend' + + if provider_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "providerId"') + end + + if name.nil? + raise Appwrite::Exception.new('Missing required parameter: "name"') + end + + api_params = { + providerId: provider_id, + name: name, + apiKey: api_key, + fromName: from_name, + fromEmail: from_email, + replyToName: reply_to_name, + replyToEmail: reply_to_email, + enabled: enabled, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'POST', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Provider + ) + end + + # Update a Resend provider by its unique ID. + # + # @param [String] provider_id Provider ID. + # @param [String] name Provider name. + # @param [] enabled Set as enabled. + # @param [String] api_key Resend API key. + # @param [String] from_name Sender Name. + # @param [String] from_email Sender email address. + # @param [String] reply_to_name Name set in the Reply To field for the mail. Default value is Sender Name. + # @param [String] reply_to_email Email set in the Reply To field for the mail. Default value is Sender Email. + # + # @return [Provider] + def update_resend_provider(provider_id:, name: nil, enabled: nil, api_key: nil, from_name: nil, from_email: nil, reply_to_name: nil, reply_to_email: nil) + api_path = '/messaging/providers/resend/{providerId}' + .gsub('{providerId}', provider_id) + + if provider_id.nil? + raise Appwrite::Exception.new('Missing required parameter: "providerId"') + end + + api_params = { + name: name, + enabled: enabled, + apiKey: api_key, + fromName: from_name, + fromEmail: from_email, + replyToName: reply_to_name, + replyToEmail: reply_to_email, + } + + api_headers = { + "content-type": 'application/json', + } + + @client.call( + method: 'PATCH', + path: api_path, + headers: api_headers, + params: api_params, + response_type: Models::Provider + ) + end + # Create a new Sendgrid provider. # # @param [String] provider_id Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. @@ -1453,9 +1551,10 @@ def delete_provider(provider_id:) # # @param [String] provider_id Provider ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [LogList] - def list_provider_logs(provider_id:, queries: nil) + def list_provider_logs(provider_id:, queries: nil, total: nil) api_path = '/messaging/providers/{providerId}/logs' .gsub('{providerId}', provider_id) @@ -1465,6 +1564,7 @@ def list_provider_logs(provider_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -1483,9 +1583,10 @@ def list_provider_logs(provider_id:, queries: nil) # # @param [String] subscriber_id Subscriber ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [LogList] - def list_subscriber_logs(subscriber_id:, queries: nil) + def list_subscriber_logs(subscriber_id:, queries: nil, total: nil) api_path = '/messaging/subscribers/{subscriberId}/logs' .gsub('{subscriberId}', subscriber_id) @@ -1495,6 +1596,7 @@ def list_subscriber_logs(subscriber_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -1513,14 +1615,16 @@ def list_subscriber_logs(subscriber_id:, queries: nil) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [TopicList] - def list_topics(queries: nil, search: nil) + def list_topics(queries: nil, search: nil, total: nil) api_path = '/messaging/topics' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -1667,9 +1771,10 @@ def delete_topic(topic_id:) # # @param [String] topic_id Topic ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [LogList] - def list_topic_logs(topic_id:, queries: nil) + def list_topic_logs(topic_id:, queries: nil, total: nil) api_path = '/messaging/topics/{topicId}/logs' .gsub('{topicId}', topic_id) @@ -1679,6 +1784,7 @@ def list_topic_logs(topic_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -1698,9 +1804,10 @@ def list_topic_logs(topic_id:, queries: nil) # @param [String] topic_id Topic ID. The topic ID subscribed to. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [SubscriberList] - def list_subscribers(topic_id:, queries: nil, search: nil) + def list_subscribers(topic_id:, queries: nil, search: nil, total: nil) api_path = '/messaging/topics/{topicId}/subscribers' .gsub('{topicId}', topic_id) @@ -1711,6 +1818,7 @@ def list_subscribers(topic_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { diff --git a/lib/appwrite/services/sites.rb b/lib/appwrite/services/sites.rb index d139c75..ac26b5c 100644 --- a/lib/appwrite/services/sites.rb +++ b/lib/appwrite/services/sites.rb @@ -12,14 +12,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [SiteList] - def list(queries: nil, search: nil) + def list(queries: nil, search: nil, total: nil) api_path = '/sites' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -323,9 +325,10 @@ def update_site_deployment(site_id:, deployment_id:) # @param [String] site_id Site ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [DeploymentList] - def list_deployments(site_id:, queries: nil, search: nil) + def list_deployments(site_id:, queries: nil, search: nil, total: nil) api_path = '/sites/{siteId}/deployments' .gsub('{siteId}', site_id) @@ -336,6 +339,7 @@ def list_deployments(site_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -696,9 +700,10 @@ def update_deployment_status(site_id:, deployment_id:) # # @param [String] site_id Site ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [ExecutionList] - def list_logs(site_id:, queries: nil) + def list_logs(site_id:, queries: nil, total: nil) api_path = '/sites/{siteId}/logs' .gsub('{siteId}', site_id) @@ -708,6 +713,7 @@ def list_logs(site_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { diff --git a/lib/appwrite/services/storage.rb b/lib/appwrite/services/storage.rb index 1d020e7..e2dfc04 100644 --- a/lib/appwrite/services/storage.rb +++ b/lib/appwrite/services/storage.rb @@ -12,14 +12,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [BucketList] - def list_buckets(queries: nil, search: nil) + def list_buckets(queries: nil, search: nil, total: nil) api_path = '/storage/buckets' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -199,9 +201,10 @@ def delete_bucket(bucket_id:) # @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [FileList] - def list_files(bucket_id:, queries: nil, search: nil) + def list_files(bucket_id:, queries: nil, search: nil, total: nil) api_path = '/storage/buckets/{bucketId}/files' .gsub('{bucketId}', bucket_id) @@ -212,6 +215,7 @@ def list_files(bucket_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { diff --git a/lib/appwrite/services/tables_db.rb b/lib/appwrite/services/tables_db.rb index f69bf12..fbf78bc 100644 --- a/lib/appwrite/services/tables_db.rb +++ b/lib/appwrite/services/tables_db.rb @@ -12,14 +12,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [DatabaseList] - def list(queries: nil, search: nil) + def list(queries: nil, search: nil, total: nil) api_path = '/tablesdb' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -342,9 +344,10 @@ def delete(database_id:) # @param [String] database_id Database ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [TableList] - def list_tables(database_id:, queries: nil, search: nil) + def list_tables(database_id:, queries: nil, search: nil, total: nil) api_path = '/tablesdb/{databaseId}/tables' .gsub('{databaseId}', database_id) @@ -355,6 +358,7 @@ def list_tables(database_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -541,9 +545,10 @@ def delete_table(database_id:, table_id:) # @param [String] database_id Database ID. # @param [String] table_id Table ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [ColumnList] - def list_columns(database_id:, table_id:, queries: nil) + def list_columns(database_id:, table_id:, queries: nil, total: nil) api_path = '/tablesdb/{databaseId}/tables/{tableId}/columns' .gsub('{databaseId}', database_id) .gsub('{tableId}', table_id) @@ -558,6 +563,7 @@ def list_columns(database_id:, table_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -2081,9 +2087,10 @@ def update_relationship_column(database_id:, table_id:, key:, on_delete: nil, ne # @param [String] database_id Database ID. # @param [String] table_id Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [ColumnIndexList] - def list_indexes(database_id:, table_id:, queries: nil) + def list_indexes(database_id:, table_id:, queries: nil, total: nil) api_path = '/tablesdb/{databaseId}/tables/{tableId}/indexes' .gsub('{databaseId}', database_id) .gsub('{tableId}', table_id) @@ -2098,6 +2105,7 @@ def list_indexes(database_id:, table_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -2258,9 +2266,10 @@ def delete_index(database_id:, table_id:, key:) # @param [String] table_id Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. # @param [String] transaction_id Transaction ID to read uncommitted changes within the transaction. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [RowList] - def list_rows(database_id:, table_id:, queries: nil, transaction_id: nil) + def list_rows(database_id:, table_id:, queries: nil, transaction_id: nil, total: nil) api_path = '/tablesdb/{databaseId}/tables/{tableId}/rows' .gsub('{databaseId}', database_id) .gsub('{tableId}', table_id) @@ -2276,6 +2285,7 @@ def list_rows(database_id:, table_id:, queries: nil, transaction_id: nil) api_params = { queries: queries, transactionId: transaction_id, + total: total, } api_headers = { diff --git a/lib/appwrite/services/teams.rb b/lib/appwrite/services/teams.rb index dc07e0c..90ae6f3 100644 --- a/lib/appwrite/services/teams.rb +++ b/lib/appwrite/services/teams.rb @@ -12,14 +12,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [TeamList] - def list(queries: nil, search: nil) + def list(queries: nil, search: nil, total: nil) api_path = '/teams' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -172,9 +174,10 @@ def delete(team_id:) # @param [String] team_id Team ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [MembershipList] - def list_memberships(team_id:, queries: nil, search: nil) + def list_memberships(team_id:, queries: nil, search: nil, total: nil) api_path = '/teams/{teamId}/memberships' .gsub('{teamId}', team_id) @@ -185,6 +188,7 @@ def list_memberships(team_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { diff --git a/lib/appwrite/services/tokens.rb b/lib/appwrite/services/tokens.rb index a2a7c32..0c04727 100644 --- a/lib/appwrite/services/tokens.rb +++ b/lib/appwrite/services/tokens.rb @@ -13,9 +13,10 @@ def initialize(client) # @param [String] bucket_id Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). # @param [String] file_id File unique ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [ResourceTokenList] - def list(bucket_id:, file_id:, queries: nil) + def list(bucket_id:, file_id:, queries: nil, total: nil) api_path = '/tokens/buckets/{bucketId}/files/{fileId}' .gsub('{bucketId}', bucket_id) .gsub('{fileId}', file_id) @@ -30,6 +31,7 @@ def list(bucket_id:, file_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { diff --git a/lib/appwrite/services/users.rb b/lib/appwrite/services/users.rb index 4128398..f79f38f 100644 --- a/lib/appwrite/services/users.rb +++ b/lib/appwrite/services/users.rb @@ -12,14 +12,16 @@ def initialize(client) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [UserList] - def list(queries: nil, search: nil) + def list(queries: nil, search: nil, total: nil) api_path = '/users' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -167,14 +169,16 @@ def create_bcrypt_user(user_id:, email:, password:, name: nil) # # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [IdentityList] - def list_identities(queries: nil, search: nil) + def list_identities(queries: nil, search: nil, total: nil) api_path = '/users/identities' api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -673,9 +677,10 @@ def update_labels(user_id:, labels:) # # @param [String] user_id User ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [LogList] - def list_logs(user_id:, queries: nil) + def list_logs(user_id:, queries: nil, total: nil) api_path = '/users/{userId}/logs' .gsub('{userId}', user_id) @@ -685,6 +690,7 @@ def list_logs(user_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { @@ -704,9 +710,10 @@ def list_logs(user_id:, queries: nil) # @param [String] user_id User ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles # @param [String] search Search term to filter your list results. Max length: 256 chars. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [MembershipList] - def list_memberships(user_id:, queries: nil, search: nil) + def list_memberships(user_id:, queries: nil, search: nil, total: nil) api_path = '/users/{userId}/memberships' .gsub('{userId}', user_id) @@ -717,6 +724,7 @@ def list_memberships(user_id:, queries: nil, search: nil) api_params = { queries: queries, search: search, + total: total, } api_headers = { @@ -1096,9 +1104,10 @@ def update_prefs(user_id:, prefs:) # Get the user sessions list by its unique ID. # # @param [String] user_id User ID. + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [SessionList] - def list_sessions(user_id:) + def list_sessions(user_id:, total: nil) api_path = '/users/{userId}/sessions' .gsub('{userId}', user_id) @@ -1107,6 +1116,7 @@ def list_sessions(user_id:) end api_params = { + total: total, } api_headers = { @@ -1257,9 +1267,10 @@ def update_status(user_id:, status:) # # @param [String] user_id User ID. # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType + # @param [] total When set to false, the total count returned will be 0 and will not be calculated. # # @return [TargetList] - def list_targets(user_id:, queries: nil) + def list_targets(user_id:, queries: nil, total: nil) api_path = '/users/{userId}/targets' .gsub('{userId}', user_id) @@ -1269,6 +1280,7 @@ def list_targets(user_id:, queries: nil) api_params = { queries: queries, + total: total, } api_headers = { From 02d5d0e22f5c1f08df11859dbe46611c921f9bcc Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 3 Nov 2025 17:39:02 +1300 Subject: [PATCH 2/2] Update changelogs --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a69b1..c4b0df5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance * Add `Operator` class for atomic modification of rows via update, bulk update, upsert, and bulk upsert operations +* Add `create_resend_provider` and `update_resend_provider` methods to `Messaging` service ## 19.2.1