appwrite 1.0.11 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +16 -0
- data/Gemfile +1 -0
- data/LICENSE +1 -1
- data/README.md +72 -5
- data/appwrite.gemspec +3 -5
- data/docs/examples/account/create-recovery.md +15 -0
- data/docs/examples/account/create-verification.md +15 -0
- data/docs/examples/account/delete-session.md +15 -0
- data/docs/examples/account/delete-sessions.md +15 -0
- data/docs/examples/account/delete.md +15 -0
- data/docs/examples/account/get-logs.md +15 -0
- data/docs/examples/account/get-prefs.md +15 -0
- data/docs/examples/account/get-sessions.md +15 -0
- data/docs/examples/account/get.md +15 -0
- data/docs/examples/account/update-email.md +15 -0
- data/docs/examples/account/update-name.md +15 -0
- data/docs/examples/account/update-password.md +15 -0
- data/docs/examples/account/update-prefs.md +15 -0
- data/docs/examples/account/update-recovery.md +15 -0
- data/docs/examples/account/update-verification.md +15 -0
- data/docs/examples/{database/get-collection-logs.md → avatars/get-initials.md} +2 -2
- data/docs/examples/database/create-document.md +1 -1
- data/docs/examples/database/update-collection.md +1 -1
- data/docs/examples/database/update-document.md +1 -1
- data/docs/examples/functions/create-execution.md +15 -0
- data/docs/examples/functions/create-tag.md +15 -0
- data/docs/examples/functions/create.md +15 -0
- data/docs/examples/functions/delete-tag.md +15 -0
- data/docs/examples/functions/delete.md +15 -0
- data/docs/examples/functions/get-execution.md +15 -0
- data/docs/examples/functions/get-tag.md +15 -0
- data/docs/examples/functions/get.md +15 -0
- data/docs/examples/functions/list-executions.md +15 -0
- data/docs/examples/functions/list-tags.md +15 -0
- data/docs/examples/functions/list.md +15 -0
- data/docs/examples/functions/update-tag.md +15 -0
- data/docs/examples/functions/update.md +15 -0
- data/docs/examples/locale/get-languages.md +15 -0
- data/docs/examples/storage/create-file.md +1 -1
- data/docs/examples/teams/delete-membership.md +1 -1
- data/docs/examples/teams/update-membership-roles.md +15 -0
- data/docs/examples/teams/update-membership-status.md +15 -0
- data/docs/examples/users/delete.md +15 -0
- data/docs/examples/users/update-status.md +1 -1
- data/lib/appwrite.rb +5 -0
- data/lib/appwrite/client.rb +46 -5
- data/lib/appwrite/exception.rb +14 -0
- data/lib/appwrite/file.rb +23 -0
- data/lib/appwrite/services/account.rb +280 -0
- data/lib/appwrite/services/avatars.rb +133 -34
- data/lib/appwrite/services/database.rb +199 -67
- data/lib/appwrite/services/functions.rb +357 -0
- data/lib/appwrite/services/health.rb +12 -24
- data/lib/appwrite/services/locale.rb +16 -12
- data/lib/appwrite/services/storage.rb +124 -35
- data/lib/appwrite/services/teams.rb +187 -34
- data/lib/appwrite/services/users.rb +115 -31
- metadata +44 -11
@@ -4,8 +4,7 @@ module Appwrite
|
|
4
4
|
def get()
|
5
5
|
path = '/health'
|
6
6
|
|
7
|
-
params = {
|
8
|
-
}
|
7
|
+
params = {}
|
9
8
|
|
10
9
|
return @client.call('get', path, {
|
11
10
|
'content-type' => 'application/json',
|
@@ -15,8 +14,7 @@ module Appwrite
|
|
15
14
|
def get_anti_virus()
|
16
15
|
path = '/health/anti-virus'
|
17
16
|
|
18
|
-
params = {
|
19
|
-
}
|
17
|
+
params = {}
|
20
18
|
|
21
19
|
return @client.call('get', path, {
|
22
20
|
'content-type' => 'application/json',
|
@@ -26,8 +24,7 @@ module Appwrite
|
|
26
24
|
def get_cache()
|
27
25
|
path = '/health/cache'
|
28
26
|
|
29
|
-
params = {
|
30
|
-
}
|
27
|
+
params = {}
|
31
28
|
|
32
29
|
return @client.call('get', path, {
|
33
30
|
'content-type' => 'application/json',
|
@@ -37,8 +34,7 @@ module Appwrite
|
|
37
34
|
def get_d_b()
|
38
35
|
path = '/health/db'
|
39
36
|
|
40
|
-
params = {
|
41
|
-
}
|
37
|
+
params = {}
|
42
38
|
|
43
39
|
return @client.call('get', path, {
|
44
40
|
'content-type' => 'application/json',
|
@@ -48,8 +44,7 @@ module Appwrite
|
|
48
44
|
def get_queue_certificates()
|
49
45
|
path = '/health/queue/certificates'
|
50
46
|
|
51
|
-
params = {
|
52
|
-
}
|
47
|
+
params = {}
|
53
48
|
|
54
49
|
return @client.call('get', path, {
|
55
50
|
'content-type' => 'application/json',
|
@@ -59,8 +54,7 @@ module Appwrite
|
|
59
54
|
def get_queue_functions()
|
60
55
|
path = '/health/queue/functions'
|
61
56
|
|
62
|
-
params = {
|
63
|
-
}
|
57
|
+
params = {}
|
64
58
|
|
65
59
|
return @client.call('get', path, {
|
66
60
|
'content-type' => 'application/json',
|
@@ -70,8 +64,7 @@ module Appwrite
|
|
70
64
|
def get_queue_logs()
|
71
65
|
path = '/health/queue/logs'
|
72
66
|
|
73
|
-
params = {
|
74
|
-
}
|
67
|
+
params = {}
|
75
68
|
|
76
69
|
return @client.call('get', path, {
|
77
70
|
'content-type' => 'application/json',
|
@@ -81,8 +74,7 @@ module Appwrite
|
|
81
74
|
def get_queue_tasks()
|
82
75
|
path = '/health/queue/tasks'
|
83
76
|
|
84
|
-
params = {
|
85
|
-
}
|
77
|
+
params = {}
|
86
78
|
|
87
79
|
return @client.call('get', path, {
|
88
80
|
'content-type' => 'application/json',
|
@@ -92,8 +84,7 @@ module Appwrite
|
|
92
84
|
def get_queue_usage()
|
93
85
|
path = '/health/queue/usage'
|
94
86
|
|
95
|
-
params = {
|
96
|
-
}
|
87
|
+
params = {}
|
97
88
|
|
98
89
|
return @client.call('get', path, {
|
99
90
|
'content-type' => 'application/json',
|
@@ -103,8 +94,7 @@ module Appwrite
|
|
103
94
|
def get_queue_webhooks()
|
104
95
|
path = '/health/queue/webhooks'
|
105
96
|
|
106
|
-
params = {
|
107
|
-
}
|
97
|
+
params = {}
|
108
98
|
|
109
99
|
return @client.call('get', path, {
|
110
100
|
'content-type' => 'application/json',
|
@@ -114,8 +104,7 @@ module Appwrite
|
|
114
104
|
def get_storage_local()
|
115
105
|
path = '/health/storage/local'
|
116
106
|
|
117
|
-
params = {
|
118
|
-
}
|
107
|
+
params = {}
|
119
108
|
|
120
109
|
return @client.call('get', path, {
|
121
110
|
'content-type' => 'application/json',
|
@@ -125,8 +114,7 @@ module Appwrite
|
|
125
114
|
def get_time()
|
126
115
|
path = '/health/time'
|
127
116
|
|
128
|
-
params = {
|
129
|
-
}
|
117
|
+
params = {}
|
130
118
|
|
131
119
|
return @client.call('get', path, {
|
132
120
|
'content-type' => 'application/json',
|
@@ -4,8 +4,7 @@ module Appwrite
|
|
4
4
|
def get()
|
5
5
|
path = '/locale'
|
6
6
|
|
7
|
-
params = {
|
8
|
-
}
|
7
|
+
params = {}
|
9
8
|
|
10
9
|
return @client.call('get', path, {
|
11
10
|
'content-type' => 'application/json',
|
@@ -15,8 +14,7 @@ module Appwrite
|
|
15
14
|
def get_continents()
|
16
15
|
path = '/locale/continents'
|
17
16
|
|
18
|
-
params = {
|
19
|
-
}
|
17
|
+
params = {}
|
20
18
|
|
21
19
|
return @client.call('get', path, {
|
22
20
|
'content-type' => 'application/json',
|
@@ -26,8 +24,7 @@ module Appwrite
|
|
26
24
|
def get_countries()
|
27
25
|
path = '/locale/countries'
|
28
26
|
|
29
|
-
params = {
|
30
|
-
}
|
27
|
+
params = {}
|
31
28
|
|
32
29
|
return @client.call('get', path, {
|
33
30
|
'content-type' => 'application/json',
|
@@ -37,8 +34,7 @@ module Appwrite
|
|
37
34
|
def get_countries_e_u()
|
38
35
|
path = '/locale/countries/eu'
|
39
36
|
|
40
|
-
params = {
|
41
|
-
}
|
37
|
+
params = {}
|
42
38
|
|
43
39
|
return @client.call('get', path, {
|
44
40
|
'content-type' => 'application/json',
|
@@ -48,8 +44,7 @@ module Appwrite
|
|
48
44
|
def get_countries_phones()
|
49
45
|
path = '/locale/countries/phones'
|
50
46
|
|
51
|
-
params = {
|
52
|
-
}
|
47
|
+
params = {}
|
53
48
|
|
54
49
|
return @client.call('get', path, {
|
55
50
|
'content-type' => 'application/json',
|
@@ -59,8 +54,17 @@ module Appwrite
|
|
59
54
|
def get_currencies()
|
60
55
|
path = '/locale/currencies'
|
61
56
|
|
62
|
-
params = {
|
63
|
-
|
57
|
+
params = {}
|
58
|
+
|
59
|
+
return @client.call('get', path, {
|
60
|
+
'content-type' => 'application/json',
|
61
|
+
}, params);
|
62
|
+
end
|
63
|
+
|
64
|
+
def get_languages()
|
65
|
+
path = '/locale/languages'
|
66
|
+
|
67
|
+
params = {}
|
64
68
|
|
65
69
|
return @client.call('get', path, {
|
66
70
|
'content-type' => 'application/json',
|
@@ -1,29 +1,52 @@
|
|
1
1
|
module Appwrite
|
2
2
|
class Storage < Service
|
3
3
|
|
4
|
-
def list_files(search:
|
4
|
+
def list_files(search: nil, limit: nil, offset: nil, order_type: nil)
|
5
5
|
path = '/storage/files'
|
6
6
|
|
7
|
-
params = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
params = {}
|
8
|
+
|
9
|
+
if !search.nil?
|
10
|
+
params[:search] = search
|
11
|
+
end
|
12
|
+
|
13
|
+
if !limit.nil?
|
14
|
+
params[:limit] = limit
|
15
|
+
end
|
16
|
+
|
17
|
+
if !offset.nil?
|
18
|
+
params[:offset] = offset
|
19
|
+
end
|
20
|
+
|
21
|
+
if !order_type.nil?
|
22
|
+
params[:orderType] = order_type
|
23
|
+
end
|
13
24
|
|
14
25
|
return @client.call('get', path, {
|
15
26
|
'content-type' => 'application/json',
|
16
27
|
}, params);
|
17
28
|
end
|
18
29
|
|
19
|
-
def create_file(file:, read
|
30
|
+
def create_file(file:, read: nil, write: nil)
|
31
|
+
if file.nil?
|
32
|
+
raise Appwrite::Exception.new('Missing required parameter: "file"')
|
33
|
+
end
|
34
|
+
|
20
35
|
path = '/storage/files'
|
21
36
|
|
22
|
-
params = {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
37
|
+
params = {}
|
38
|
+
|
39
|
+
if !file.nil?
|
40
|
+
params[:file] = file
|
41
|
+
end
|
42
|
+
|
43
|
+
if !read.nil?
|
44
|
+
params[:read] = read
|
45
|
+
end
|
46
|
+
|
47
|
+
if !write.nil?
|
48
|
+
params[:write] = write
|
49
|
+
end
|
27
50
|
|
28
51
|
return @client.call('post', path, {
|
29
52
|
'content-type' => 'multipart/form-data',
|
@@ -31,11 +54,14 @@ module Appwrite
|
|
31
54
|
end
|
32
55
|
|
33
56
|
def get_file(file_id:)
|
57
|
+
if file_id.nil?
|
58
|
+
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
59
|
+
end
|
60
|
+
|
34
61
|
path = '/storage/files/{fileId}'
|
35
62
|
.gsub('{fileId}', file_id)
|
36
63
|
|
37
|
-
params = {
|
38
|
-
}
|
64
|
+
params = {}
|
39
65
|
|
40
66
|
return @client.call('get', path, {
|
41
67
|
'content-type' => 'application/json',
|
@@ -43,13 +69,30 @@ module Appwrite
|
|
43
69
|
end
|
44
70
|
|
45
71
|
def update_file(file_id:, read:, write:)
|
72
|
+
if file_id.nil?
|
73
|
+
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
74
|
+
end
|
75
|
+
|
76
|
+
if read.nil?
|
77
|
+
raise Appwrite::Exception.new('Missing required parameter: "read"')
|
78
|
+
end
|
79
|
+
|
80
|
+
if write.nil?
|
81
|
+
raise Appwrite::Exception.new('Missing required parameter: "write"')
|
82
|
+
end
|
83
|
+
|
46
84
|
path = '/storage/files/{fileId}'
|
47
85
|
.gsub('{fileId}', file_id)
|
48
86
|
|
49
|
-
params = {
|
50
|
-
|
51
|
-
|
52
|
-
|
87
|
+
params = {}
|
88
|
+
|
89
|
+
if !read.nil?
|
90
|
+
params[:read] = read
|
91
|
+
end
|
92
|
+
|
93
|
+
if !write.nil?
|
94
|
+
params[:write] = write
|
95
|
+
end
|
53
96
|
|
54
97
|
return @client.call('put', path, {
|
55
98
|
'content-type' => 'application/json',
|
@@ -57,11 +100,14 @@ module Appwrite
|
|
57
100
|
end
|
58
101
|
|
59
102
|
def delete_file(file_id:)
|
103
|
+
if file_id.nil?
|
104
|
+
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
105
|
+
end
|
106
|
+
|
60
107
|
path = '/storage/files/{fileId}'
|
61
108
|
.gsub('{fileId}', file_id)
|
62
109
|
|
63
|
-
params = {
|
64
|
-
}
|
110
|
+
params = {}
|
65
111
|
|
66
112
|
return @client.call('delete', path, {
|
67
113
|
'content-type' => 'application/json',
|
@@ -69,41 +115,84 @@ module Appwrite
|
|
69
115
|
end
|
70
116
|
|
71
117
|
def get_file_download(file_id:)
|
118
|
+
if file_id.nil?
|
119
|
+
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
120
|
+
end
|
121
|
+
|
72
122
|
path = '/storage/files/{fileId}/download'
|
73
123
|
.gsub('{fileId}', file_id)
|
74
124
|
|
75
|
-
params = {
|
76
|
-
}
|
125
|
+
params = {}
|
77
126
|
|
78
127
|
return @client.call('get', path, {
|
79
128
|
'content-type' => 'application/json',
|
80
129
|
}, params);
|
81
130
|
end
|
82
131
|
|
83
|
-
def get_file_preview(file_id:, width:
|
132
|
+
def get_file_preview(file_id:, width: nil, height: nil, quality: nil, border_width: nil, border_color: nil, border_radius: nil, opacity: nil, rotation: nil, background: nil, output: nil)
|
133
|
+
if file_id.nil?
|
134
|
+
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
135
|
+
end
|
136
|
+
|
84
137
|
path = '/storage/files/{fileId}/preview'
|
85
138
|
.gsub('{fileId}', file_id)
|
86
139
|
|
87
|
-
params = {
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
140
|
+
params = {}
|
141
|
+
|
142
|
+
if !width.nil?
|
143
|
+
params[:width] = width
|
144
|
+
end
|
145
|
+
|
146
|
+
if !height.nil?
|
147
|
+
params[:height] = height
|
148
|
+
end
|
149
|
+
|
150
|
+
if !quality.nil?
|
151
|
+
params[:quality] = quality
|
152
|
+
end
|
153
|
+
|
154
|
+
if !border_width.nil?
|
155
|
+
params[:borderWidth] = border_width
|
156
|
+
end
|
157
|
+
|
158
|
+
if !border_color.nil?
|
159
|
+
params[:borderColor] = border_color
|
160
|
+
end
|
161
|
+
|
162
|
+
if !border_radius.nil?
|
163
|
+
params[:borderRadius] = border_radius
|
164
|
+
end
|
165
|
+
|
166
|
+
if !opacity.nil?
|
167
|
+
params[:opacity] = opacity
|
168
|
+
end
|
169
|
+
|
170
|
+
if !rotation.nil?
|
171
|
+
params[:rotation] = rotation
|
172
|
+
end
|
173
|
+
|
174
|
+
if !background.nil?
|
175
|
+
params[:background] = background
|
176
|
+
end
|
177
|
+
|
178
|
+
if !output.nil?
|
179
|
+
params[:output] = output
|
180
|
+
end
|
94
181
|
|
95
182
|
return @client.call('get', path, {
|
96
183
|
'content-type' => 'application/json',
|
97
184
|
}, params);
|
98
185
|
end
|
99
186
|
|
100
|
-
def get_file_view(file_id
|
187
|
+
def get_file_view(file_id:)
|
188
|
+
if file_id.nil?
|
189
|
+
raise Appwrite::Exception.new('Missing required parameter: "fileId"')
|
190
|
+
end
|
191
|
+
|
101
192
|
path = '/storage/files/{fileId}/view'
|
102
193
|
.gsub('{fileId}', file_id)
|
103
194
|
|
104
|
-
params = {
|
105
|
-
'as': as
|
106
|
-
}
|
195
|
+
params = {}
|
107
196
|
|
108
197
|
return @client.call('get', path, {
|
109
198
|
'content-type' => 'application/json',
|
@@ -1,28 +1,48 @@
|
|
1
1
|
module Appwrite
|
2
2
|
class Teams < Service
|
3
3
|
|
4
|
-
def list(search:
|
4
|
+
def list(search: nil, limit: nil, offset: nil, order_type: nil)
|
5
5
|
path = '/teams'
|
6
6
|
|
7
|
-
params = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
params = {}
|
8
|
+
|
9
|
+
if !search.nil?
|
10
|
+
params[:search] = search
|
11
|
+
end
|
12
|
+
|
13
|
+
if !limit.nil?
|
14
|
+
params[:limit] = limit
|
15
|
+
end
|
16
|
+
|
17
|
+
if !offset.nil?
|
18
|
+
params[:offset] = offset
|
19
|
+
end
|
20
|
+
|
21
|
+
if !order_type.nil?
|
22
|
+
params[:orderType] = order_type
|
23
|
+
end
|
13
24
|
|
14
25
|
return @client.call('get', path, {
|
15
26
|
'content-type' => 'application/json',
|
16
27
|
}, params);
|
17
28
|
end
|
18
29
|
|
19
|
-
def create(name:, roles:
|
30
|
+
def create(name:, roles: nil)
|
31
|
+
if name.nil?
|
32
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
33
|
+
end
|
34
|
+
|
20
35
|
path = '/teams'
|
21
36
|
|
22
|
-
params = {
|
23
|
-
|
24
|
-
|
25
|
-
|
37
|
+
params = {}
|
38
|
+
|
39
|
+
if !name.nil?
|
40
|
+
params[:name] = name
|
41
|
+
end
|
42
|
+
|
43
|
+
if !roles.nil?
|
44
|
+
params[:roles] = roles
|
45
|
+
end
|
26
46
|
|
27
47
|
return @client.call('post', path, {
|
28
48
|
'content-type' => 'application/json',
|
@@ -30,11 +50,14 @@ module Appwrite
|
|
30
50
|
end
|
31
51
|
|
32
52
|
def get(team_id:)
|
53
|
+
if team_id.nil?
|
54
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
55
|
+
end
|
56
|
+
|
33
57
|
path = '/teams/{teamId}'
|
34
58
|
.gsub('{teamId}', team_id)
|
35
59
|
|
36
|
-
params = {
|
37
|
-
}
|
60
|
+
params = {}
|
38
61
|
|
39
62
|
return @client.call('get', path, {
|
40
63
|
'content-type' => 'application/json',
|
@@ -42,12 +65,22 @@ module Appwrite
|
|
42
65
|
end
|
43
66
|
|
44
67
|
def update(team_id:, name:)
|
68
|
+
if team_id.nil?
|
69
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
70
|
+
end
|
71
|
+
|
72
|
+
if name.nil?
|
73
|
+
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
74
|
+
end
|
75
|
+
|
45
76
|
path = '/teams/{teamId}'
|
46
77
|
.gsub('{teamId}', team_id)
|
47
78
|
|
48
|
-
params = {
|
49
|
-
|
50
|
-
|
79
|
+
params = {}
|
80
|
+
|
81
|
+
if !name.nil?
|
82
|
+
params[:name] = name
|
83
|
+
end
|
51
84
|
|
52
85
|
return @client.call('put', path, {
|
53
86
|
'content-type' => 'application/json',
|
@@ -55,58 +88,178 @@ module Appwrite
|
|
55
88
|
end
|
56
89
|
|
57
90
|
def delete(team_id:)
|
91
|
+
if team_id.nil?
|
92
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
93
|
+
end
|
94
|
+
|
58
95
|
path = '/teams/{teamId}'
|
59
96
|
.gsub('{teamId}', team_id)
|
60
97
|
|
61
|
-
params = {
|
62
|
-
}
|
98
|
+
params = {}
|
63
99
|
|
64
100
|
return @client.call('delete', path, {
|
65
101
|
'content-type' => 'application/json',
|
66
102
|
}, params);
|
67
103
|
end
|
68
104
|
|
69
|
-
def get_memberships(team_id:)
|
105
|
+
def get_memberships(team_id:, search: nil, limit: nil, offset: nil, order_type: nil)
|
106
|
+
if team_id.nil?
|
107
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
108
|
+
end
|
109
|
+
|
70
110
|
path = '/teams/{teamId}/memberships'
|
71
111
|
.gsub('{teamId}', team_id)
|
72
112
|
|
73
|
-
params = {
|
74
|
-
|
113
|
+
params = {}
|
114
|
+
|
115
|
+
if !search.nil?
|
116
|
+
params[:search] = search
|
117
|
+
end
|
118
|
+
|
119
|
+
if !limit.nil?
|
120
|
+
params[:limit] = limit
|
121
|
+
end
|
122
|
+
|
123
|
+
if !offset.nil?
|
124
|
+
params[:offset] = offset
|
125
|
+
end
|
126
|
+
|
127
|
+
if !order_type.nil?
|
128
|
+
params[:orderType] = order_type
|
129
|
+
end
|
75
130
|
|
76
131
|
return @client.call('get', path, {
|
77
132
|
'content-type' => 'application/json',
|
78
133
|
}, params);
|
79
134
|
end
|
80
135
|
|
81
|
-
def create_membership(team_id:, email:, roles:, url:, name:
|
136
|
+
def create_membership(team_id:, email:, roles:, url:, name: nil)
|
137
|
+
if team_id.nil?
|
138
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
139
|
+
end
|
140
|
+
|
141
|
+
if email.nil?
|
142
|
+
raise Appwrite::Exception.new('Missing required parameter: "email"')
|
143
|
+
end
|
144
|
+
|
145
|
+
if roles.nil?
|
146
|
+
raise Appwrite::Exception.new('Missing required parameter: "roles"')
|
147
|
+
end
|
148
|
+
|
149
|
+
if url.nil?
|
150
|
+
raise Appwrite::Exception.new('Missing required parameter: "url"')
|
151
|
+
end
|
152
|
+
|
82
153
|
path = '/teams/{teamId}/memberships'
|
83
154
|
.gsub('{teamId}', team_id)
|
84
155
|
|
85
|
-
params = {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
156
|
+
params = {}
|
157
|
+
|
158
|
+
if !email.nil?
|
159
|
+
params[:email] = email
|
160
|
+
end
|
161
|
+
|
162
|
+
if !name.nil?
|
163
|
+
params[:name] = name
|
164
|
+
end
|
165
|
+
|
166
|
+
if !roles.nil?
|
167
|
+
params[:roles] = roles
|
168
|
+
end
|
169
|
+
|
170
|
+
if !url.nil?
|
171
|
+
params[:url] = url
|
172
|
+
end
|
91
173
|
|
92
174
|
return @client.call('post', path, {
|
93
175
|
'content-type' => 'application/json',
|
94
176
|
}, params);
|
95
177
|
end
|
96
178
|
|
97
|
-
def
|
98
|
-
|
179
|
+
def update_membership_roles(team_id:, membership_id:, roles:)
|
180
|
+
if team_id.nil?
|
181
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
182
|
+
end
|
183
|
+
|
184
|
+
if membership_id.nil?
|
185
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
186
|
+
end
|
187
|
+
|
188
|
+
if roles.nil?
|
189
|
+
raise Appwrite::Exception.new('Missing required parameter: "roles"')
|
190
|
+
end
|
191
|
+
|
192
|
+
path = '/teams/{teamId}/memberships/{membershipId}'
|
99
193
|
.gsub('{teamId}', team_id)
|
100
|
-
.gsub('{
|
194
|
+
.gsub('{membershipId}', membership_id)
|
195
|
+
|
196
|
+
params = {}
|
197
|
+
|
198
|
+
if !roles.nil?
|
199
|
+
params[:roles] = roles
|
200
|
+
end
|
101
201
|
|
102
|
-
|
103
|
-
|
202
|
+
return @client.call('patch', path, {
|
203
|
+
'content-type' => 'application/json',
|
204
|
+
}, params);
|
205
|
+
end
|
206
|
+
|
207
|
+
def delete_membership(team_id:, membership_id:)
|
208
|
+
if team_id.nil?
|
209
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
210
|
+
end
|
211
|
+
|
212
|
+
if membership_id.nil?
|
213
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
214
|
+
end
|
215
|
+
|
216
|
+
path = '/teams/{teamId}/memberships/{membershipId}'
|
217
|
+
.gsub('{teamId}', team_id)
|
218
|
+
.gsub('{membershipId}', membership_id)
|
219
|
+
|
220
|
+
params = {}
|
104
221
|
|
105
222
|
return @client.call('delete', path, {
|
106
223
|
'content-type' => 'application/json',
|
107
224
|
}, params);
|
108
225
|
end
|
109
226
|
|
227
|
+
def update_membership_status(team_id:, membership_id:, user_id:, secret:)
|
228
|
+
if team_id.nil?
|
229
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
230
|
+
end
|
231
|
+
|
232
|
+
if membership_id.nil?
|
233
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
234
|
+
end
|
235
|
+
|
236
|
+
if user_id.nil?
|
237
|
+
raise Appwrite::Exception.new('Missing required parameter: "userId"')
|
238
|
+
end
|
239
|
+
|
240
|
+
if secret.nil?
|
241
|
+
raise Appwrite::Exception.new('Missing required parameter: "secret"')
|
242
|
+
end
|
243
|
+
|
244
|
+
path = '/teams/{teamId}/memberships/{membershipId}/status'
|
245
|
+
.gsub('{teamId}', team_id)
|
246
|
+
.gsub('{membershipId}', membership_id)
|
247
|
+
|
248
|
+
params = {}
|
249
|
+
|
250
|
+
if !user_id.nil?
|
251
|
+
params[:userId] = user_id
|
252
|
+
end
|
253
|
+
|
254
|
+
if !secret.nil?
|
255
|
+
params[:secret] = secret
|
256
|
+
end
|
257
|
+
|
258
|
+
return @client.call('patch', path, {
|
259
|
+
'content-type' => 'application/json',
|
260
|
+
}, params);
|
261
|
+
end
|
262
|
+
|
110
263
|
|
111
264
|
protected
|
112
265
|
|