@@ -4,8 +4,7 @@ class Account < Service
4
4
def get ( )
5
5
path = '/account'
6
6
7
- params = {
8
- }
7
+ params = { }
9
8
10
9
return @client . call ( 'get' , path , {
11
10
'content-type' => 'application/json' ,
@@ -15,21 +14,33 @@ def get()
15
14
def delete ( )
16
15
path = '/account'
17
16
18
- params = {
19
- }
17
+ params = { }
20
18
21
19
return @client . call ( 'delete' , path , {
22
20
'content-type' => 'application/json' ,
23
21
} , params ) ;
24
22
end
25
23
26
24
def update_email ( email :, password :)
25
+ if email . nil?
26
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "email"' )
27
+ end
28
+
29
+ if password . nil?
30
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "password"' )
31
+ end
32
+
27
33
path = '/account/email'
28
34
29
- params = {
30
- 'email' : email ,
31
- 'password' : password
32
- }
35
+ params = { }
36
+
37
+ if !email . nil?
38
+ params [ :email ] = email
39
+ end
40
+
41
+ if !password . nil?
42
+ params [ :password ] = password
43
+ end
33
44
34
45
return @client . call ( 'patch' , path , {
35
46
'content-type' => 'application/json' ,
@@ -39,33 +50,47 @@ def update_email(email:, password:)
39
50
def get_logs ( )
40
51
path = '/account/logs'
41
52
42
- params = {
43
- }
53
+ params = { }
44
54
45
55
return @client . call ( 'get' , path , {
46
56
'content-type' => 'application/json' ,
47
57
} , params ) ;
48
58
end
49
59
50
60
def update_name ( name :)
61
+ if name . nil?
62
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "name"' )
63
+ end
64
+
51
65
path = '/account/name'
52
66
53
- params = {
54
- 'name' : name
55
- }
67
+ params = { }
68
+
69
+ if !name . nil?
70
+ params [ :name ] = name
71
+ end
56
72
57
73
return @client . call ( 'patch' , path , {
58
74
'content-type' => 'application/json' ,
59
75
} , params ) ;
60
76
end
61
77
62
- def update_password ( password :, old_password : '' )
78
+ def update_password ( password :, old_password : nil )
79
+ if password . nil?
80
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "password"' )
81
+ end
82
+
63
83
path = '/account/password'
64
84
65
- params = {
66
- 'password' : password ,
67
- 'oldPassword' : old_password
68
- }
85
+ params = { }
86
+
87
+ if !password . nil?
88
+ params [ :password ] = password
89
+ end
90
+
91
+ if !old_password . nil?
92
+ params [ :oldPassword ] = old_password
93
+ end
69
94
70
95
return @client . call ( 'patch' , path , {
71
96
'content-type' => 'application/json' ,
@@ -75,48 +100,93 @@ def update_password(password:, old_password: '')
75
100
def get_prefs ( )
76
101
path = '/account/prefs'
77
102
78
- params = {
79
- }
103
+ params = { }
80
104
81
105
return @client . call ( 'get' , path , {
82
106
'content-type' => 'application/json' ,
83
107
} , params ) ;
84
108
end
85
109
86
110
def update_prefs ( prefs :)
111
+ if prefs . nil?
112
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "prefs"' )
113
+ end
114
+
87
115
path = '/account/prefs'
88
116
89
- params = {
90
- 'prefs' : prefs
91
- }
117
+ params = { }
118
+
119
+ if !prefs . nil?
120
+ params [ :prefs ] = prefs
121
+ end
92
122
93
123
return @client . call ( 'patch' , path , {
94
124
'content-type' => 'application/json' ,
95
125
} , params ) ;
96
126
end
97
127
98
128
def create_recovery ( email :, url :)
129
+ if email . nil?
130
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "email"' )
131
+ end
132
+
133
+ if url . nil?
134
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "url"' )
135
+ end
136
+
99
137
path = '/account/recovery'
100
138
101
- params = {
102
- 'email' : email ,
103
- 'url' : url
104
- }
139
+ params = { }
140
+
141
+ if !email . nil?
142
+ params [ :email ] = email
143
+ end
144
+
145
+ if !url . nil?
146
+ params [ :url ] = url
147
+ end
105
148
106
149
return @client . call ( 'post' , path , {
107
150
'content-type' => 'application/json' ,
108
151
} , params ) ;
109
152
end
110
153
111
154
def update_recovery ( user_id :, secret :, password :, password_again :)
155
+ if user_id . nil?
156
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "userId"' )
157
+ end
158
+
159
+ if secret . nil?
160
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "secret"' )
161
+ end
162
+
163
+ if password . nil?
164
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "password"' )
165
+ end
166
+
167
+ if password_again . nil?
168
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "passwordAgain"' )
169
+ end
170
+
112
171
path = '/account/recovery'
113
172
114
- params = {
115
- 'userId' : user_id ,
116
- 'secret' : secret ,
117
- 'password' : password ,
118
- 'passwordAgain' : password_again
119
- }
173
+ params = { }
174
+
175
+ if !user_id . nil?
176
+ params [ :userId ] = user_id
177
+ end
178
+
179
+ if !secret . nil?
180
+ params [ :secret ] = secret
181
+ end
182
+
183
+ if !password . nil?
184
+ params [ :password ] = password
185
+ end
186
+
187
+ if !password_again . nil?
188
+ params [ :passwordAgain ] = password_again
189
+ end
120
190
121
191
return @client . call ( 'put' , path , {
122
192
'content-type' => 'application/json' ,
@@ -126,8 +196,7 @@ def update_recovery(user_id:, secret:, password:, password_again:)
126
196
def get_sessions ( )
127
197
path = '/account/sessions'
128
198
129
- params = {
130
- }
199
+ params = { }
131
200
132
201
return @client . call ( 'get' , path , {
133
202
'content-type' => 'application/json' ,
@@ -137,45 +206,66 @@ def get_sessions()
137
206
def delete_sessions ( )
138
207
path = '/account/sessions'
139
208
140
- params = {
141
- }
209
+ params = { }
142
210
143
211
return @client . call ( 'delete' , path , {
144
212
'content-type' => 'application/json' ,
145
213
} , params ) ;
146
214
end
147
215
148
216
def delete_session ( session_id :)
217
+ if session_id . nil?
218
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "sessionId"' )
219
+ end
220
+
149
221
path = '/account/sessions/{sessionId}'
150
222
. gsub ( '{sessionId}' , session_id )
151
223
152
- params = {
153
- }
224
+ params = { }
154
225
155
226
return @client . call ( 'delete' , path , {
156
227
'content-type' => 'application/json' ,
157
228
} , params ) ;
158
229
end
159
230
160
231
def create_verification ( url :)
232
+ if url . nil?
233
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "url"' )
234
+ end
235
+
161
236
path = '/account/verification'
162
237
163
- params = {
164
- 'url' : url
165
- }
238
+ params = { }
239
+
240
+ if !url . nil?
241
+ params [ :url ] = url
242
+ end
166
243
167
244
return @client . call ( 'post' , path , {
168
245
'content-type' => 'application/json' ,
169
246
} , params ) ;
170
247
end
171
248
172
249
def update_verification ( user_id :, secret :)
250
+ if user_id . nil?
251
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "userId"' )
252
+ end
253
+
254
+ if secret . nil?
255
+ raise Appwrite ::Exception . new ( 'Missing required parameter: "secret"' )
256
+ end
257
+
173
258
path = '/account/verification'
174
259
175
- params = {
176
- 'userId' : user_id ,
177
- 'secret' : secret
178
- }
260
+ params = { }
261
+
262
+ if !user_id . nil?
263
+ params [ :userId ] = user_id
264
+ end
265
+
266
+ if !secret . nil?
267
+ params [ :secret ] = secret
268
+ end
179
269
180
270
return @client . call ( 'put' , path , {
181
271
'content-type' => 'application/json' ,
0 commit comments