Skip to content

Commit 322a408

Browse files
authored
Merge pull request #49 from appwrite/dev
feat: Ruby SDK update for version 20.0.0
2 parents 23dc3c6 + 7cccbb3 commit 322a408

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+665
-43
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 20.0.0
4+
5+
* Rename `VCSDeploymentType` enum to `VCSReferenceType`
6+
* Change `create_template_deployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
7+
* Add `get_screenshot` method to `Avatars` service
8+
* Add `Theme`, `Timezone` and `Output` enums
9+
310
## 19.3.0
411

512
* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance

appwrite.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |spec|
22

33
spec.name = 'appwrite'
4-
spec.version = '19.3.0'
4+
spec.version = '20.0.0'
55
spec.license = 'BSD-3-Clause'
66
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'
77
spec.author = 'Appwrite Team'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
require 'appwrite'
2+
3+
include Appwrite
4+
include Appwrite::Enums
5+
6+
client = Client.new
7+
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
8+
.set_project('<YOUR_PROJECT_ID>') # Your project ID
9+
.set_session('') # The user session to authenticate with
10+
11+
avatars = Avatars.new(client)
12+
13+
result = avatars.get_screenshot(
14+
url: 'https://example.com',
15+
headers: {
16+
"Authorization" => "Bearer token123",
17+
"X-Custom-Header" => "value"
18+
}, # optional
19+
viewport_width: 1920, # optional
20+
viewport_height: 1080, # optional
21+
scale: 2, # optional
22+
theme: Theme::LIGHT, # optional
23+
user_agent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', # optional
24+
fullpage: true, # optional
25+
locale: 'en-US', # optional
26+
timezone: Timezone::AFRICA_ABIDJAN, # optional
27+
latitude: 37.7749, # optional
28+
longitude: -122.4194, # optional
29+
accuracy: 100, # optional
30+
touch: true, # optional
31+
permissions: ["geolocation","notifications"], # optional
32+
sleep: 3, # optional
33+
width: 800, # optional
34+
height: 600, # optional
35+
quality: 85, # optional
36+
output: Output::JPG # optional
37+
)

docs/examples/databases/update-relationship-attribute.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'appwrite'
22

33
include Appwrite
4+
include Appwrite::Enums
45

56
client = Client.new
67
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint

docs/examples/functions/create-execution.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'appwrite'
22

33
include Appwrite
4+
include Appwrite::Enums
45

56
client = Client.new
67
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint

docs/examples/functions/create-template-deployment.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'appwrite'
22

33
include Appwrite
4+
include Appwrite::Enums
45

56
client = Client.new
67
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -14,6 +15,7 @@ result = functions.create_template_deployment(
1415
repository: '<REPOSITORY>',
1516
owner: '<OWNER>',
1617
root_directory: '<ROOT_DIRECTORY>',
17-
version: '<VERSION>',
18+
type: TemplateReferenceType::COMMIT,
19+
reference: '<REFERENCE>',
1820
activate: false # optional
1921
)

docs/examples/functions/create-vcs-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ functions = Functions.new(client)
1212

1313
result = functions.create_vcs_deployment(
1414
function_id: '<FUNCTION_ID>',
15-
type: VCSDeploymentType::BRANCH,
15+
type: VCSReferenceType::BRANCH,
1616
reference: '<REFERENCE>',
1717
activate: false # optional
1818
)

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ functions = Functions.new(client)
1313
result = functions.create(
1414
function_id: '<FUNCTION_ID>',
1515
name: '<NAME>',
16-
runtime: ::NODE_14_5,
16+
runtime: Runtime::NODE_14_5,
1717
execute: ["any"], # optional
1818
events: [], # optional
1919
schedule: '', # optional

docs/examples/functions/get-deployment-download.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'appwrite'
22

33
include Appwrite
4+
include Appwrite::Enums
45

56
client = Client.new
67
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint

docs/examples/functions/update.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require 'appwrite'
22

33
include Appwrite
4+
include Appwrite::Enums
45

56
client = Client.new
67
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
@@ -12,7 +13,7 @@ functions = Functions.new(client)
1213
result = functions.update(
1314
function_id: '<FUNCTION_ID>',
1415
name: '<NAME>',
15-
runtime: ::NODE_14_5, # optional
16+
runtime: Runtime::NODE_14_5, # optional
1617
execute: ["any"], # optional
1718
events: [], # optional
1819
schedule: '', # optional

0 commit comments

Comments
 (0)