Skip to content

Commit

Permalink
chore: release rc
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Aug 17, 2024
1 parent 6d0eae5 commit 35e13f6
Show file tree
Hide file tree
Showing 18 changed files with 370 additions and 30 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Appwrite Ruby SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.5.7-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
Expand Down
4 changes: 2 additions & 2 deletions appwrite.gemspec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Gem::Specification.new do |spec|

spec.name = 'appwrite'
spec.version = '11.0.2'
spec.version = '12.0.0-rc.1'
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'
spec.homepage = 'https://appwrite.io/support'
spec.email = 'team@appwrite.io'
spec.email = 'team@localhost.test'
spec.files = Dir['lib/**/*.rb']

spec.add_dependency 'mime-types', '~> 3.4.1'
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ client = Client.new
account = Account.new(client)

result = account.delete_mfa_authenticator(
type: AuthenticatorType::TOTP,
otp: '<OTP>'
type: AuthenticatorType::TOTP
)
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ result = functions.create(
template_repository: '<TEMPLATE_REPOSITORY>', # optional
template_owner: '<TEMPLATE_OWNER>', # optional
template_root_directory: '<TEMPLATE_ROOT_DIRECTORY>', # optional
template_branch: '<TEMPLATE_BRANCH>' # optional
template_version: '<TEMPLATE_VERSION>' # optional
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ include Appwrite
client = Client.new
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
.set_session('') # The user session to authenticate with

functions = Functions.new(client)

result = functions.download_deployment(
result = functions.get_deployment_download(
function_id: '<FUNCTION_ID>',
deployment_id: '<DEPLOYMENT_ID>'
)
13 changes: 13 additions & 0 deletions docs/examples/functions/get-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID

functions = Functions.new(client)

result = functions.get_template(
template_id: '<TEMPLATE_ID>'
)
16 changes: 16 additions & 0 deletions docs/examples/functions/list-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'appwrite'

include Appwrite

client = Client.new
.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID

functions = Functions.new(client)

result = functions.list_templates(
runtimes: [], # optional
use_cases: [], # optional
limit: 1, # optional
offset: 0 # optional
)
4 changes: 4 additions & 0 deletions lib/appwrite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
require_relative 'appwrite/models/team_list'
require_relative 'appwrite/models/membership_list'
require_relative 'appwrite/models/function_list'
require_relative 'appwrite/models/template_function_list'
require_relative 'appwrite/models/runtime_list'
require_relative 'appwrite/models/deployment_list'
require_relative 'appwrite/models/execution_list'
Expand Down Expand Up @@ -76,6 +77,9 @@
require_relative 'appwrite/models/team'
require_relative 'appwrite/models/membership'
require_relative 'appwrite/models/function'
require_relative 'appwrite/models/template_function'
require_relative 'appwrite/models/template_runtime'
require_relative 'appwrite/models/template_variable'
require_relative 'appwrite/models/runtime'
require_relative 'appwrite/models/deployment'
require_relative 'appwrite/models/execution'
Expand Down
4 changes: 2 additions & 2 deletions lib/appwrite/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def initialize
'x-sdk-name'=> 'Ruby',
'x-sdk-platform'=> 'server',
'x-sdk-language'=> 'ruby',
'x-sdk-version'=> '11.0.2',
'X-Appwrite-Response-Format' => '1.5.0'
'x-sdk-version'=> '12.0.0-rc.1',
'X-Appwrite-Response-Format' => '1.6.0'
}
@endpoint = 'https://cloud.appwrite.io/v1'
end
Expand Down
11 changes: 8 additions & 3 deletions lib/appwrite/models/execution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Execution
attr_reader :logs
attr_reader :errors
attr_reader :duration
attr_reader :scheduled_at

def initialize(
id:,
Expand All @@ -36,7 +37,8 @@ def initialize(
response_headers:,
logs:,
errors:,
duration:
duration:,
scheduled_at:
)
@id = id
@created_at = created_at
Expand All @@ -54,6 +56,7 @@ def initialize(
@logs = logs
@errors = errors
@duration = duration
@scheduled_at = scheduled_at
end

def self.from(map:)
Expand All @@ -73,7 +76,8 @@ def self.from(map:)
response_headers: map["responseHeaders"].map { |it| Headers.from(map: it) },
logs: map["logs"],
errors: map["errors"],
duration: map["duration"]
duration: map["duration"],
scheduled_at: map["scheduledAt"]
)
end

Expand All @@ -94,7 +98,8 @@ def to_map
"responseHeaders": @response_headers.map { |it| it.to_map },
"logs": @logs,
"errors": @errors,
"duration": @duration
"duration": @duration,
"scheduledAt": @scheduled_at
}
end
end
Expand Down
5 changes: 5 additions & 0 deletions lib/appwrite/models/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Appwrite
module Models
class Runtime
attr_reader :id
attr_reader :key
attr_reader :name
attr_reader :version
attr_reader :base
Expand All @@ -13,6 +14,7 @@ class Runtime

def initialize(
id:,
key:,
name:,
version:,
base:,
Expand All @@ -21,6 +23,7 @@ def initialize(
supports:
)
@id = id
@key = key
@name = name
@version = version
@base = base
Expand All @@ -32,6 +35,7 @@ def initialize(
def self.from(map:)
Runtime.new(
id: map["$id"],
key: map["key"],
name: map["name"],
version: map["version"],
base: map["base"],
Expand All @@ -44,6 +48,7 @@ def self.from(map:)
def to_map
{
"$id": @id,
"key": @key,
"name": @name,
"version": @version,
"base": @base,
Expand Down
107 changes: 107 additions & 0 deletions lib/appwrite/models/template_function.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#frozen_string_literal: true

module Appwrite
module Models
class TemplateFunction
attr_reader :icon
attr_reader :id
attr_reader :name
attr_reader :tagline
attr_reader :permissions
attr_reader :events
attr_reader :cron
attr_reader :timeout
attr_reader :use_cases
attr_reader :runtimes
attr_reader :instructions
attr_reader :vcs_provider
attr_reader :provider_repository_id
attr_reader :provider_owner
attr_reader :provider_version
attr_reader :variables
attr_reader :scopes

def initialize(
icon:,
id:,
name:,
tagline:,
permissions:,
events:,
cron:,
timeout:,
use_cases:,
runtimes:,
instructions:,
vcs_provider:,
provider_repository_id:,
provider_owner:,
provider_version:,
variables:,
scopes:
)
@icon = icon
@id = id
@name = name
@tagline = tagline
@permissions = permissions
@events = events
@cron = cron
@timeout = timeout
@use_cases = use_cases
@runtimes = runtimes
@instructions = instructions
@vcs_provider = vcs_provider
@provider_repository_id = provider_repository_id
@provider_owner = provider_owner
@provider_version = provider_version
@variables = variables
@scopes = scopes
end

def self.from(map:)
TemplateFunction.new(
icon: map["icon"],
id: map["id"],
name: map["name"],
tagline: map["tagline"],
permissions: map["permissions"],
events: map["events"],
cron: map["cron"],
timeout: map["timeout"],
use_cases: map["useCases"],
runtimes: map["runtimes"].map { |it| TemplateRuntime.from(map: it) },
instructions: map["instructions"],
vcs_provider: map["vcsProvider"],
provider_repository_id: map["providerRepositoryId"],
provider_owner: map["providerOwner"],
provider_version: map["providerVersion"],
variables: map["variables"].map { |it| TemplateVariable.from(map: it) },
scopes: map["scopes"]
)
end

def to_map
{
"icon": @icon,
"id": @id,
"name": @name,
"tagline": @tagline,
"permissions": @permissions,
"events": @events,
"cron": @cron,
"timeout": @timeout,
"useCases": @use_cases,
"runtimes": @runtimes.map { |it| it.to_map },
"instructions": @instructions,
"vcsProvider": @vcs_provider,
"providerRepositoryId": @provider_repository_id,
"providerOwner": @provider_owner,
"providerVersion": @provider_version,
"variables": @variables.map { |it| it.to_map },
"scopes": @scopes
}
end
end
end
end
32 changes: 32 additions & 0 deletions lib/appwrite/models/template_function_list.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#frozen_string_literal: true

module Appwrite
module Models
class TemplateFunctionList
attr_reader :total
attr_reader :templates

def initialize(
total:,
templates:
)
@total = total
@templates = templates
end

def self.from(map:)
TemplateFunctionList.new(
total: map["total"],
templates: map["templates"].map { |it| TemplateFunction.from(map: it) }
)
end

def to_map
{
"total": @total,
"templates": @templates.map { |it| it.to_map }
}
end
end
end
end
42 changes: 42 additions & 0 deletions lib/appwrite/models/template_runtime.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#frozen_string_literal: true

module Appwrite
module Models
class TemplateRuntime
attr_reader :name
attr_reader :commands
attr_reader :entrypoint
attr_reader :provider_root_directory

def initialize(
name:,
commands:,
entrypoint:,
provider_root_directory:
)
@name = name
@commands = commands
@entrypoint = entrypoint
@provider_root_directory = provider_root_directory
end

def self.from(map:)
TemplateRuntime.new(
name: map["name"],
commands: map["commands"],
entrypoint: map["entrypoint"],
provider_root_directory: map["providerRootDirectory"]
)
end

def to_map
{
"name": @name,
"commands": @commands,
"entrypoint": @entrypoint,
"providerRootDirectory": @provider_root_directory
}
end
end
end
end
Loading

0 comments on commit 35e13f6

Please sign in to comment.