Skip to content

Commit fe39a1a

Browse files
implement realtime feature
1 parent d21f715 commit fe39a1a

File tree

8 files changed

+121
-7
lines changed

8 files changed

+121
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Appwrite Ruby SDK
22

33
![License](https://img.shields.io/github/license/appwrite/sdk-for-ruby.svg?style=flat-square)
4-
![Version](https://img.shields.io/badge/api%20version-0.9.0-blue.svg?style=flat-square)
4+
![Version](https://img.shields.io/badge/api%20version-0.10.0-blue.svg?style=flat-square)
55
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 0.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
9+
**This SDK is compatible with Appwrite server version 0.10.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-ruby/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Ruby SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1212

@@ -80,7 +80,7 @@ end
8080
```
8181

8282
### Learn more
83-
You can use following resources to learn more and get help
83+
You can use the following resources to learn more and get help
8484
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
8585
- 📜 [Appwrite Docs](https://appwrite.io/docs)
8686
- 💬 [Discord Community](https://appwrite.io/discord)

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 |s|
22

33
s.name = 'appwrite'
4-
s.version = '2.3.0'
4+
s.version = '2.4.0'
55
s.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"
66
s.author = 'Appwrite Team'
77
s.homepage = 'https://appwrite.io/support'

docs/examples/functions/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ client
1010

1111
functions = Appwrite::Functions.new(client);
1212

13-
response = functions.create(name: '[NAME]', execute: [], runtime: 'java-11.0');
13+
response = functions.create(name: '[NAME]', execute: [], runtime: 'dotnet-5.0');
1414

1515
puts response

docs/examples/users/update-email.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'appwrite'
2+
3+
client = Appwrite::Client.new()
4+
5+
client
6+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_project('5df5acd0d48c2') # Your project ID
8+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9+
;
10+
11+
users = Appwrite::Users.new(client);
12+
13+
response = users.update_email(user_id: '[USER_ID]', email: '[email protected]');
14+
15+
puts response

docs/examples/users/update-name.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'appwrite'
2+
3+
client = Appwrite::Client.new()
4+
5+
client
6+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_project('5df5acd0d48c2') # Your project ID
8+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9+
;
10+
11+
users = Appwrite::Users.new(client);
12+
13+
response = users.update_name(user_id: '[USER_ID]', name: '[NAME]');
14+
15+
puts response
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'appwrite'
2+
3+
client = Appwrite::Client.new()
4+
5+
client
6+
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint
7+
.set_project('5df5acd0d48c2') # Your project ID
8+
.set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key
9+
;
10+
11+
users = Appwrite::Users.new(client);
12+
13+
response = users.update_password(user_id: '[USER_ID]', password: 'password');
14+
15+
puts response

lib/appwrite/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def initialize()
2020
@headers = {
2121
'content-type' => '',
2222
'user-agent' => RUBY_PLATFORM + ':ruby-' + RUBY_VERSION,
23-
'x-sdk-version' => 'appwrite:ruby:2.3.0',
24-
'X-Appwrite-Response-Format' => '0.9.0'
23+
'x-sdk-version' => 'appwrite:ruby:2.4.0',
24+
'X-Appwrite-Response-Format' => '0.10.0'
2525
}
2626
@endpoint = 'https://appwrite.io/v1';
2727
end

lib/appwrite/services/users.rb

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,29 @@ def delete(user_id:)
8787
}, params);
8888
end
8989

90+
def update_email(user_id:, email:)
91+
if user_id.nil?
92+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
93+
end
94+
95+
if email.nil?
96+
raise Appwrite::Exception.new('Missing required parameter: "email"')
97+
end
98+
99+
path = '/users/{userId}/email'
100+
.gsub('{userId}', user_id)
101+
102+
params = {}
103+
104+
if !email.nil?
105+
params[:email] = email
106+
end
107+
108+
return @client.call('patch', path, {
109+
'content-type' => 'application/json',
110+
}, params);
111+
end
112+
90113
def get_logs(user_id:)
91114
if user_id.nil?
92115
raise Appwrite::Exception.new('Missing required parameter: "userId"')
@@ -102,6 +125,52 @@ def get_logs(user_id:)
102125
}, params);
103126
end
104127

128+
def update_name(user_id:, name:)
129+
if user_id.nil?
130+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
131+
end
132+
133+
if name.nil?
134+
raise Appwrite::Exception.new('Missing required parameter: "name"')
135+
end
136+
137+
path = '/users/{userId}/name'
138+
.gsub('{userId}', user_id)
139+
140+
params = {}
141+
142+
if !name.nil?
143+
params[:name] = name
144+
end
145+
146+
return @client.call('patch', path, {
147+
'content-type' => 'application/json',
148+
}, params);
149+
end
150+
151+
def update_password(user_id:, password:)
152+
if user_id.nil?
153+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
154+
end
155+
156+
if password.nil?
157+
raise Appwrite::Exception.new('Missing required parameter: "password"')
158+
end
159+
160+
path = '/users/{userId}/password'
161+
.gsub('{userId}', user_id)
162+
163+
params = {}
164+
165+
if !password.nil?
166+
params[:password] = password
167+
end
168+
169+
return @client.call('patch', path, {
170+
'content-type' => 'application/json',
171+
}, params);
172+
end
173+
105174
def get_prefs(user_id:)
106175
if user_id.nil?
107176
raise Appwrite::Exception.new('Missing required parameter: "userId"')

0 commit comments

Comments
 (0)