From 3a55946c26282be2dae445e2a843c8d75fe84e0c Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Fri, 9 Oct 2026 14:25:50 +0100 Subject: [PATCH] feat: SDK update for version 28.2.0 --- CHANGELOG.md | 5 +++++ appwrite.gemspec | 2 +- docs/examples/functions/create.md | 3 ++- docs/examples/functions/update.md | 3 ++- lib/appwrite/client.rb | 2 +- lib/appwrite/models/billing_plan.rb | 5 +++++ lib/appwrite/models/function.rb | 5 +++++ lib/appwrite/services/functions.rb | 14 ++++++++++---- 8 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11edfbb..5051946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 28.2.0 + +* Added: optional `interval` parameter on `functions.create` and `functions.update` to run a function every N minutes +* Added: `interval` on the `Function` model and `functionsIntervalMinimum` on the `BillingPlan` model + ## 28.1.0 * Added: optional `state` parameter on `createOAuth2Token`, returned unchanged on the success and failure URLs diff --git a/appwrite.gemspec b/appwrite.gemspec index f207b59..14229fc 100644 --- a/appwrite.gemspec +++ b/appwrite.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |spec| spec.name = 'appwrite' - spec.version = '28.1.0' + spec.version = '28.2.0' spec.license = 'BSD-3-Clause' spec.summary = 'Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API' spec.author = 'Appwrite Team' diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 49c3726..b5b1c7d 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -33,6 +33,7 @@ result = functions.create( provider_paths: [], # optional build_specification: 's-1vcpu-512mb', # optional runtime_specification: 's-1vcpu-512mb', # optional - deployment_retention: 0 # optional + deployment_retention: 0, # optional + interval: 0 # optional ) ``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index d0bb4c8..ff418bd 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -33,6 +33,7 @@ result = functions.update( provider_paths: [], # optional build_specification: 's-1vcpu-512mb', # optional runtime_specification: 's-1vcpu-512mb', # optional - deployment_retention: 0 # optional + deployment_retention: 0, # optional + interval: 0 # optional ) ``` diff --git a/lib/appwrite/client.rb b/lib/appwrite/client.rb index c6fbe43..63fb784 100644 --- a/lib/appwrite/client.rb +++ b/lib/appwrite/client.rb @@ -14,7 +14,7 @@ def initialize 'x-sdk-name' => 'Ruby', 'x-sdk-platform' => 'server', 'x-sdk-language' => 'ruby', - 'x-sdk-version' => '28.1.0', + 'x-sdk-version' => '28.2.0', 'X-Appwrite-Response-Format' => '2.0.0' } @endpoint = 'https://cloud.appwrite.io/v1' diff --git a/lib/appwrite/models/billing_plan.rb b/lib/appwrite/models/billing_plan.rb index 4f8c18a..cac6349 100644 --- a/lib/appwrite/models/billing_plan.rb +++ b/lib/appwrite/models/billing_plan.rb @@ -69,6 +69,7 @@ class BillingPlan attr_reader :backup_policies attr_reader :deployment_size attr_reader :build_size + attr_reader :functions_interval_minimum attr_reader :databases_allow_encrypt attr_reader :limits attr_reader :group @@ -143,6 +144,7 @@ def initialize( backup_policies:, deployment_size:, build_size:, + functions_interval_minimum:, databases_allow_encrypt:, limits:, group:, @@ -216,6 +218,7 @@ def initialize( @backup_policies = backup_policies @deployment_size = deployment_size @build_size = build_size + @functions_interval_minimum = functions_interval_minimum @databases_allow_encrypt = databases_allow_encrypt @limits = limits @group = validate_group(group) @@ -292,6 +295,7 @@ def self.from(map:) backup_policies: map["backupPolicies"], deployment_size: map["deploymentSize"], build_size: map["buildSize"], + functions_interval_minimum: map["functionsIntervalMinimum"], databases_allow_encrypt: map["databasesAllowEncrypt"], limits: map["limits"].nil? ? nil : BillingPlanLimits.from(map: map["limits"]), group: map["group"], @@ -369,6 +373,7 @@ def to_map "backupPolicies": @backup_policies, "deploymentSize": @deployment_size, "buildSize": @build_size, + "functionsIntervalMinimum": @functions_interval_minimum, "databasesAllowEncrypt": @databases_allow_encrypt, "limits": @limits&.to_map, "group": @group, diff --git a/lib/appwrite/models/function.rb b/lib/appwrite/models/function.rb index 0e76555..6d8b38b 100644 --- a/lib/appwrite/models/function.rb +++ b/lib/appwrite/models/function.rb @@ -22,6 +22,7 @@ class Function attr_reader :vars attr_reader :events attr_reader :schedule + attr_reader :interval attr_reader :timeout attr_reader :entrypoint attr_reader :commands @@ -56,6 +57,7 @@ def initialize( vars:, events:, schedule:, + interval:, timeout:, entrypoint:, commands:, @@ -89,6 +91,7 @@ def initialize( @vars = vars @events = events @schedule = schedule + @interval = interval @timeout = timeout @entrypoint = entrypoint @commands = commands @@ -125,6 +128,7 @@ def self.from(map:) vars: map["vars"].map { |it| Variable.from(map: it) }, events: map["events"], schedule: map["schedule"], + interval: map["interval"], timeout: map["timeout"], entrypoint: map["entrypoint"], commands: map["commands"], @@ -162,6 +166,7 @@ def to_map "vars": @vars.map { |it| it.to_map }, "events": @events, "schedule": @schedule, + "interval": @interval, "timeout": @timeout, "entrypoint": @entrypoint, "commands": @commands, diff --git a/lib/appwrite/services/functions.rb b/lib/appwrite/services/functions.rb index 0d51438..52ceb96 100644 --- a/lib/appwrite/services/functions.rb +++ b/lib/appwrite/services/functions.rb @@ -51,7 +51,7 @@ def list( # @param [Runtime] runtime Execution runtime. # @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. # @param [Array] events Events list. Maximum of 100 events are allowed. - # @param [String] schedule Schedule CRON syntax. + # @param [String] schedule Schedule CRON syntax. Cannot be combined with interval. # @param [Integer] timeout Function maximum execution time in seconds. # @param [] enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. # @param [] logging When disabled, executions will exclude logs and errors, and will be slightly faster. @@ -68,6 +68,7 @@ def list( # @param [String] build_specification Build specification for the function deployments. # @param [String] runtime_specification Runtime specification for the function executions. # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. + # @param [Integer] interval Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. # # @return [Function] def create( @@ -92,7 +93,8 @@ def create( provider_paths: nil, build_specification: nil, runtime_specification: nil, - deployment_retention: nil + deployment_retention: nil, + interval: nil ) api_path = '/functions' @@ -131,6 +133,7 @@ def create( buildSpecification: build_specification, runtimeSpecification: runtime_specification, deploymentRetention: deployment_retention, + interval: interval, } api_headers = { @@ -237,7 +240,7 @@ def get( # @param [Runtime] runtime Execution runtime. # @param [Array] execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long. # @param [Array] events Events list. Maximum of 100 events are allowed. - # @param [String] schedule Schedule CRON syntax. + # @param [String] schedule Schedule CRON syntax. Cannot be combined with interval. # @param [Integer] timeout Maximum execution time in seconds. # @param [] enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled. # @param [] logging When disabled, executions will exclude logs and errors, and will be slightly faster. @@ -254,6 +257,7 @@ def get( # @param [String] build_specification Build specification for the function deployments. # @param [String] runtime_specification Runtime specification for the function executions. # @param [Integer] deployment_retention Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept. + # @param [Integer] interval Minutes between scheduled executions. Appwrite picks when within each interval the function runs. Use 0 to disable. Cannot be combined with schedule. When omitted, the current interval is kept unless schedule is set. # # @return [Function] def update( @@ -278,7 +282,8 @@ def update( provider_paths: nil, build_specification: nil, runtime_specification: nil, - deployment_retention: nil + deployment_retention: nil, + interval: nil ) api_path = '/functions/{functionId}' .gsub('{functionId}', function_id) @@ -313,6 +318,7 @@ def update( buildSpecification: build_specification, runtimeSpecification: runtime_specification, deploymentRetention: deployment_retention, + interval: interval, } api_headers = {