appwrite 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +134 -57
- data/lib/appwrite/exception.rb +5 -7
- data/lib/appwrite/file.rb +5 -13
- data/lib/appwrite/models/attribute_boolean.rb +52 -0
- data/lib/appwrite/models/attribute_email.rb +57 -0
- data/lib/appwrite/models/attribute_enum.rb +62 -0
- data/lib/appwrite/models/attribute_float.rb +62 -0
- data/lib/appwrite/models/attribute_integer.rb +62 -0
- data/lib/appwrite/models/attribute_ip.rb +57 -0
- data/lib/appwrite/models/attribute_list.rb +32 -0
- data/lib/appwrite/models/attribute_string.rb +57 -0
- data/lib/appwrite/models/attribute_url.rb +57 -0
- data/lib/appwrite/models/collection.rb +62 -0
- data/lib/appwrite/models/collection_list.rb +32 -0
- data/lib/appwrite/models/continent.rb +32 -0
- data/lib/appwrite/models/continent_list.rb +32 -0
- data/lib/appwrite/models/country.rb +32 -0
- data/lib/appwrite/models/country_list.rb +32 -0
- data/lib/appwrite/models/currency.rb +57 -0
- data/lib/appwrite/models/currency_list.rb +32 -0
- data/lib/appwrite/models/document.rb +50 -0
- data/lib/appwrite/models/document_list.rb +36 -0
- data/lib/appwrite/models/execution.rb +72 -0
- data/lib/appwrite/models/execution_list.rb +32 -0
- data/lib/appwrite/models/file.rb +62 -0
- data/lib/appwrite/models/file_list.rb +32 -0
- data/lib/appwrite/models/function.rb +92 -0
- data/lib/appwrite/models/function_list.rb +32 -0
- data/lib/appwrite/models/health_antivirus.rb +32 -0
- data/lib/appwrite/models/health_queue.rb +27 -0
- data/lib/appwrite/models/health_status.rb +32 -0
- data/lib/appwrite/models/health_time.rb +37 -0
- data/lib/appwrite/models/index.rb +47 -0
- data/lib/appwrite/models/index_list.rb +32 -0
- data/lib/appwrite/models/language.rb +37 -0
- data/lib/appwrite/models/language_list.rb +32 -0
- data/lib/appwrite/models/locale.rb +57 -0
- data/lib/appwrite/models/log.rb +127 -0
- data/lib/appwrite/models/log_list.rb +32 -0
- data/lib/appwrite/models/membership.rb +67 -0
- data/lib/appwrite/models/membership_list.rb +32 -0
- data/lib/appwrite/models/phone.rb +37 -0
- data/lib/appwrite/models/phone_list.rb +32 -0
- data/lib/appwrite/models/preferences.rb +30 -0
- data/lib/appwrite/models/runtime.rb +57 -0
- data/lib/appwrite/models/runtime_list.rb +32 -0
- data/lib/appwrite/models/session.rb +132 -0
- data/lib/appwrite/models/session_list.rb +32 -0
- data/lib/appwrite/models/tag.rb +47 -0
- data/lib/appwrite/models/tag_list.rb +32 -0
- data/lib/appwrite/models/team.rb +42 -0
- data/lib/appwrite/models/team_list.rb +32 -0
- data/lib/appwrite/models/token.rb +42 -0
- data/lib/appwrite/models/user.rb +62 -0
- data/lib/appwrite/models/user_list.rb +32 -0
- data/lib/appwrite/query.rb +42 -0
- data/lib/appwrite/service.rb +0 -5
- data/lib/appwrite/services/account.rb +380 -133
- data/lib/appwrite/services/avatars.rb +189 -125
- data/lib/appwrite/services/database.rb +876 -130
- data/lib/appwrite/services/functions.rb +366 -184
- data/lib/appwrite/services/health.rb +202 -58
- data/lib/appwrite/services/locale.rb +134 -32
- data/lib/appwrite/services/storage.rb +211 -118
- data/lib/appwrite/services/teams.rb +299 -118
- data/lib/appwrite/services/users.rb +372 -85
- data/lib/appwrite.rb +55 -0
- metadata +72 -103
- data/.travis.yml +0 -16
- data/CHANGELOG.md +0 -1
- data/Gemfile +0 -4
- data/LICENSE +0 -12
- data/README.md +0 -97
- data/appwrite.gemspec +0 -11
- data/docs/examples/account/create-recovery.md +0 -15
- data/docs/examples/account/create-verification.md +0 -15
- data/docs/examples/account/delete-session.md +0 -15
- data/docs/examples/account/delete-sessions.md +0 -15
- data/docs/examples/account/delete.md +0 -15
- data/docs/examples/account/get-logs.md +0 -15
- data/docs/examples/account/get-prefs.md +0 -15
- data/docs/examples/account/get-sessions.md +0 -15
- data/docs/examples/account/get.md +0 -15
- data/docs/examples/account/update-email.md +0 -15
- data/docs/examples/account/update-name.md +0 -15
- data/docs/examples/account/update-password.md +0 -15
- data/docs/examples/account/update-prefs.md +0 -15
- data/docs/examples/account/update-recovery.md +0 -15
- data/docs/examples/account/update-verification.md +0 -15
- data/docs/examples/avatars/get-browser.md +0 -15
- data/docs/examples/avatars/get-credit-card.md +0 -15
- data/docs/examples/avatars/get-favicon.md +0 -15
- data/docs/examples/avatars/get-flag.md +0 -15
- data/docs/examples/avatars/get-image.md +0 -15
- data/docs/examples/avatars/get-initials.md +0 -15
- data/docs/examples/avatars/get-q-r.md +0 -15
- data/docs/examples/database/create-collection.md +0 -15
- data/docs/examples/database/create-document.md +0 -15
- data/docs/examples/database/delete-collection.md +0 -15
- data/docs/examples/database/delete-document.md +0 -15
- data/docs/examples/database/get-collection.md +0 -15
- data/docs/examples/database/get-document.md +0 -15
- data/docs/examples/database/list-collections.md +0 -15
- data/docs/examples/database/list-documents.md +0 -15
- data/docs/examples/database/update-collection.md +0 -15
- data/docs/examples/database/update-document.md +0 -15
- data/docs/examples/functions/create-execution.md +0 -15
- data/docs/examples/functions/create-tag.md +0 -15
- data/docs/examples/functions/create.md +0 -15
- data/docs/examples/functions/delete-tag.md +0 -15
- data/docs/examples/functions/delete.md +0 -15
- data/docs/examples/functions/get-execution.md +0 -15
- data/docs/examples/functions/get-tag.md +0 -15
- data/docs/examples/functions/get.md +0 -15
- data/docs/examples/functions/list-executions.md +0 -15
- data/docs/examples/functions/list-tags.md +0 -15
- data/docs/examples/functions/list.md +0 -15
- data/docs/examples/functions/update-tag.md +0 -15
- data/docs/examples/functions/update.md +0 -15
- data/docs/examples/health/get-anti-virus.md +0 -15
- data/docs/examples/health/get-cache.md +0 -15
- data/docs/examples/health/get-d-b.md +0 -15
- data/docs/examples/health/get-queue-certificates.md +0 -15
- data/docs/examples/health/get-queue-functions.md +0 -15
- data/docs/examples/health/get-queue-logs.md +0 -15
- data/docs/examples/health/get-queue-tasks.md +0 -15
- data/docs/examples/health/get-queue-usage.md +0 -15
- data/docs/examples/health/get-queue-webhooks.md +0 -15
- data/docs/examples/health/get-storage-local.md +0 -15
- data/docs/examples/health/get-time.md +0 -15
- data/docs/examples/health/get.md +0 -15
- data/docs/examples/locale/get-continents.md +0 -15
- data/docs/examples/locale/get-countries-e-u.md +0 -15
- data/docs/examples/locale/get-countries-phones.md +0 -15
- data/docs/examples/locale/get-countries.md +0 -15
- data/docs/examples/locale/get-currencies.md +0 -15
- data/docs/examples/locale/get-languages.md +0 -15
- data/docs/examples/locale/get.md +0 -15
- data/docs/examples/storage/create-file.md +0 -15
- data/docs/examples/storage/delete-file.md +0 -15
- data/docs/examples/storage/get-file-download.md +0 -15
- data/docs/examples/storage/get-file-preview.md +0 -15
- data/docs/examples/storage/get-file-view.md +0 -15
- data/docs/examples/storage/get-file.md +0 -15
- data/docs/examples/storage/list-files.md +0 -15
- data/docs/examples/storage/update-file.md +0 -15
- data/docs/examples/teams/create-membership.md +0 -15
- data/docs/examples/teams/create.md +0 -15
- data/docs/examples/teams/delete-membership.md +0 -15
- data/docs/examples/teams/delete.md +0 -15
- data/docs/examples/teams/get-memberships.md +0 -15
- data/docs/examples/teams/get.md +0 -15
- data/docs/examples/teams/list.md +0 -15
- data/docs/examples/teams/update-membership-roles.md +0 -15
- data/docs/examples/teams/update-membership-status.md +0 -15
- data/docs/examples/teams/update.md +0 -15
- data/docs/examples/users/create.md +0 -15
- data/docs/examples/users/delete-session.md +0 -15
- data/docs/examples/users/delete-sessions.md +0 -15
- data/docs/examples/users/delete.md +0 -15
- data/docs/examples/users/get-logs.md +0 -15
- data/docs/examples/users/get-prefs.md +0 -15
- data/docs/examples/users/get-sessions.md +0 -15
- data/docs/examples/users/get.md +0 -15
- data/docs/examples/users/list.md +0 -15
- data/docs/examples/users/update-prefs.md +0 -15
- data/docs/examples/users/update-status.md +0 -15
@@ -1,54 +1,92 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
1
3
|
module Appwrite
|
2
4
|
class Teams < Service
|
3
5
|
|
4
|
-
|
6
|
+
include Models
|
7
|
+
# Get a list of all the teams in which the current user is a member. You can
|
8
|
+
# use the parameters to filter your results.
|
9
|
+
#
|
10
|
+
# In admin mode, this endpoint returns a list of all the teams in the current
|
11
|
+
# project. [Learn more about different API modes](/docs/admin).
|
12
|
+
#
|
13
|
+
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
14
|
+
# @param [number] limit Maximum number of teams to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
15
|
+
# @param [number] offset Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
16
|
+
# @param [string] cursor ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
17
|
+
# @param [string] cursor_direction Direction of the cursor.
|
18
|
+
# @param [string] order_type Order result by ASC or DESC order.
|
19
|
+
#
|
20
|
+
# @return [TeamList]
|
21
|
+
def list(search: nil, limit: nil, offset: nil, cursor: nil, cursor_direction: nil, order_type: nil)
|
5
22
|
path = '/teams'
|
6
23
|
|
7
|
-
params = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
24
|
+
params = {
|
25
|
+
search: search,
|
26
|
+
limit: limit,
|
27
|
+
offset: offset,
|
28
|
+
cursor: cursor,
|
29
|
+
cursorDirection: cursor_direction,
|
30
|
+
orderType: order_type,
|
31
|
+
}
|
32
|
+
|
33
|
+
headers = {
|
34
|
+
"content-type": 'application/json',
|
35
|
+
}
|
36
|
+
|
37
|
+
@client.call(
|
38
|
+
method: 'GET',
|
39
|
+
path: path,
|
40
|
+
params: params,
|
41
|
+
headers: headers,
|
42
|
+
response_type: TeamList
|
43
|
+
)
|
44
|
+
end
|
20
45
|
|
21
|
-
|
22
|
-
|
46
|
+
# Create a new team. The user who creates the team will automatically be
|
47
|
+
# assigned as the owner of the team. Only the users with the owner role can
|
48
|
+
# invite new members, add new owners and delete or update the team.
|
49
|
+
#
|
50
|
+
# @param [string] team_id Team ID. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
51
|
+
# @param [string] name Team name. Max length: 128 chars.
|
52
|
+
# @param [array] roles Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.
|
53
|
+
#
|
54
|
+
# @return [Team]
|
55
|
+
def create(team_id:, name:, roles: nil)
|
56
|
+
if team_id.nil?
|
57
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
23
58
|
end
|
24
59
|
|
25
|
-
return @client.call('get', path, {
|
26
|
-
'content-type' => 'application/json',
|
27
|
-
}, params);
|
28
|
-
end
|
29
|
-
|
30
|
-
def create(name:, roles: nil)
|
31
60
|
if name.nil?
|
32
61
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
33
62
|
end
|
34
63
|
|
35
64
|
path = '/teams'
|
36
65
|
|
37
|
-
params = {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
66
|
+
params = {
|
67
|
+
teamId: team_id,
|
68
|
+
name: name,
|
69
|
+
roles: roles,
|
70
|
+
}
|
71
|
+
|
72
|
+
headers = {
|
73
|
+
"content-type": 'application/json',
|
74
|
+
}
|
75
|
+
|
76
|
+
@client.call(
|
77
|
+
method: 'POST',
|
78
|
+
path: path,
|
79
|
+
params: params,
|
80
|
+
headers: headers,
|
81
|
+
response_type: Team
|
82
|
+
)
|
50
83
|
end
|
51
84
|
|
85
|
+
# Get a team by its ID. All team members have read access for this resource.
|
86
|
+
#
|
87
|
+
# @param [string] team_id Team ID.
|
88
|
+
#
|
89
|
+
# @return [Team]
|
52
90
|
def get(team_id:)
|
53
91
|
if team_id.nil?
|
54
92
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -57,13 +95,29 @@ module Appwrite
|
|
57
95
|
path = '/teams/{teamId}'
|
58
96
|
.gsub('{teamId}', team_id)
|
59
97
|
|
60
|
-
params = {
|
98
|
+
params = {
|
99
|
+
}
|
100
|
+
|
101
|
+
headers = {
|
102
|
+
"content-type": 'application/json',
|
103
|
+
}
|
61
104
|
|
62
|
-
|
63
|
-
|
64
|
-
|
105
|
+
@client.call(
|
106
|
+
method: 'GET',
|
107
|
+
path: path,
|
108
|
+
params: params,
|
109
|
+
headers: headers,
|
110
|
+
response_type: Team
|
111
|
+
)
|
65
112
|
end
|
66
113
|
|
114
|
+
# Update a team using its ID. Only members with the owner role can update the
|
115
|
+
# team.
|
116
|
+
#
|
117
|
+
# @param [string] team_id Team ID.
|
118
|
+
# @param [string] name New team name. Max length: 128 chars.
|
119
|
+
#
|
120
|
+
# @return [Team]
|
67
121
|
def update(team_id:, name:)
|
68
122
|
if team_id.nil?
|
69
123
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -76,17 +130,29 @@ module Appwrite
|
|
76
130
|
path = '/teams/{teamId}'
|
77
131
|
.gsub('{teamId}', team_id)
|
78
132
|
|
79
|
-
params = {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
133
|
+
params = {
|
134
|
+
name: name,
|
135
|
+
}
|
136
|
+
|
137
|
+
headers = {
|
138
|
+
"content-type": 'application/json',
|
139
|
+
}
|
140
|
+
|
141
|
+
@client.call(
|
142
|
+
method: 'PUT',
|
143
|
+
path: path,
|
144
|
+
params: params,
|
145
|
+
headers: headers,
|
146
|
+
response_type: Team
|
147
|
+
)
|
88
148
|
end
|
89
149
|
|
150
|
+
# Delete a team using its ID. Only team members with the owner role can
|
151
|
+
# delete the team.
|
152
|
+
#
|
153
|
+
# @param [string] team_id Team ID.
|
154
|
+
#
|
155
|
+
# @return []
|
90
156
|
def delete(team_id:)
|
91
157
|
if team_id.nil?
|
92
158
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -95,14 +161,34 @@ module Appwrite
|
|
95
161
|
path = '/teams/{teamId}'
|
96
162
|
.gsub('{teamId}', team_id)
|
97
163
|
|
98
|
-
params = {
|
164
|
+
params = {
|
165
|
+
}
|
99
166
|
|
100
|
-
|
101
|
-
|
102
|
-
}
|
167
|
+
headers = {
|
168
|
+
"content-type": 'application/json',
|
169
|
+
}
|
170
|
+
|
171
|
+
@client.call(
|
172
|
+
method: 'DELETE',
|
173
|
+
path: path,
|
174
|
+
params: params,
|
175
|
+
headers: headers,
|
176
|
+
)
|
103
177
|
end
|
104
178
|
|
105
|
-
|
179
|
+
# Use this endpoint to list a team's members using the team's ID. All team
|
180
|
+
# members have read access to this endpoint.
|
181
|
+
#
|
182
|
+
# @param [string] team_id Team ID.
|
183
|
+
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
184
|
+
# @param [number] limit Maximum number of memberships to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
|
185
|
+
# @param [number] offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
|
186
|
+
# @param [string] cursor ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
|
187
|
+
# @param [string] cursor_direction Direction of the cursor.
|
188
|
+
# @param [string] order_type Order result by ASC or DESC order.
|
189
|
+
#
|
190
|
+
# @return [MembershipList]
|
191
|
+
def get_memberships(team_id:, search: nil, limit: nil, offset: nil, cursor: nil, cursor_direction: nil, order_type: nil)
|
106
192
|
if team_id.nil?
|
107
193
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
108
194
|
end
|
@@ -110,29 +196,51 @@ module Appwrite
|
|
110
196
|
path = '/teams/{teamId}/memberships'
|
111
197
|
.gsub('{teamId}', team_id)
|
112
198
|
|
113
|
-
params = {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
}, params);
|
199
|
+
params = {
|
200
|
+
search: search,
|
201
|
+
limit: limit,
|
202
|
+
offset: offset,
|
203
|
+
cursor: cursor,
|
204
|
+
cursorDirection: cursor_direction,
|
205
|
+
orderType: order_type,
|
206
|
+
}
|
207
|
+
|
208
|
+
headers = {
|
209
|
+
"content-type": 'application/json',
|
210
|
+
}
|
211
|
+
|
212
|
+
@client.call(
|
213
|
+
method: 'GET',
|
214
|
+
path: path,
|
215
|
+
params: params,
|
216
|
+
headers: headers,
|
217
|
+
response_type: MembershipList
|
218
|
+
)
|
134
219
|
end
|
135
220
|
|
221
|
+
# Invite a new member to join your team. If initiated from the client SDK, an
|
222
|
+
# email with a link to join the team will be sent to the member's email
|
223
|
+
# address and an account will be created for them should they not be signed
|
224
|
+
# up already. If initiated from server-side SDKs, the new member will
|
225
|
+
# automatically be added to the team.
|
226
|
+
#
|
227
|
+
# Use the 'url' parameter to redirect the user from the invitation email back
|
228
|
+
# to your app. When the user is redirected, use the [Update Team Membership
|
229
|
+
# Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
|
230
|
+
# the user to accept the invitation to the team.
|
231
|
+
#
|
232
|
+
# Please note that to avoid a [Redirect
|
233
|
+
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
234
|
+
# the only valid redirect URL's are the once from domains you have set when
|
235
|
+
# adding your platforms in the console interface.
|
236
|
+
#
|
237
|
+
# @param [string] team_id Team ID.
|
238
|
+
# @param [string] email Email of the new team member.
|
239
|
+
# @param [array] roles Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.
|
240
|
+
# @param [string] url URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
|
241
|
+
# @param [string] name Name of the new team member. Max length: 128 chars.
|
242
|
+
#
|
243
|
+
# @return [Membership]
|
136
244
|
def create_membership(team_id:, email:, roles:, url:, name: nil)
|
137
245
|
if team_id.nil?
|
138
246
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -153,29 +261,71 @@ module Appwrite
|
|
153
261
|
path = '/teams/{teamId}/memberships'
|
154
262
|
.gsub('{teamId}', team_id)
|
155
263
|
|
156
|
-
params = {
|
264
|
+
params = {
|
265
|
+
email: email,
|
266
|
+
roles: roles,
|
267
|
+
url: url,
|
268
|
+
name: name,
|
269
|
+
}
|
270
|
+
|
271
|
+
headers = {
|
272
|
+
"content-type": 'application/json',
|
273
|
+
}
|
274
|
+
|
275
|
+
@client.call(
|
276
|
+
method: 'POST',
|
277
|
+
path: path,
|
278
|
+
params: params,
|
279
|
+
headers: headers,
|
280
|
+
response_type: Membership
|
281
|
+
)
|
282
|
+
end
|
157
283
|
|
158
|
-
|
159
|
-
|
284
|
+
# Get a team member by the membership unique id. All team members have read
|
285
|
+
# access for this resource.
|
286
|
+
#
|
287
|
+
# @param [string] team_id Team ID.
|
288
|
+
# @param [string] membership_id Membership ID.
|
289
|
+
#
|
290
|
+
# @return [MembershipList]
|
291
|
+
def get_membership(team_id:, membership_id:)
|
292
|
+
if team_id.nil?
|
293
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
160
294
|
end
|
161
295
|
|
162
|
-
if
|
163
|
-
|
296
|
+
if membership_id.nil?
|
297
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
164
298
|
end
|
165
299
|
|
166
|
-
|
167
|
-
|
168
|
-
|
300
|
+
path = '/teams/{teamId}/memberships/{membershipId}'
|
301
|
+
.gsub('{teamId}', team_id)
|
302
|
+
.gsub('{membershipId}', membership_id)
|
169
303
|
|
170
|
-
|
171
|
-
|
172
|
-
|
304
|
+
params = {
|
305
|
+
}
|
306
|
+
|
307
|
+
headers = {
|
308
|
+
"content-type": 'application/json',
|
309
|
+
}
|
173
310
|
|
174
|
-
|
175
|
-
|
176
|
-
|
311
|
+
@client.call(
|
312
|
+
method: 'GET',
|
313
|
+
path: path,
|
314
|
+
params: params,
|
315
|
+
headers: headers,
|
316
|
+
response_type: MembershipList
|
317
|
+
)
|
177
318
|
end
|
178
319
|
|
320
|
+
# Modify the roles of a team member. Only team members with the owner role
|
321
|
+
# have access to this endpoint. Learn more about [roles and
|
322
|
+
# permissions](/docs/permissions).
|
323
|
+
#
|
324
|
+
# @param [string] team_id Team ID.
|
325
|
+
# @param [string] membership_id Membership ID.
|
326
|
+
# @param [array] roles An array of strings. Use this param to set the user's roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Max length for each role is 32 chars.
|
327
|
+
#
|
328
|
+
# @return [Membership]
|
179
329
|
def update_membership_roles(team_id:, membership_id:, roles:)
|
180
330
|
if team_id.nil?
|
181
331
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -193,17 +343,31 @@ module Appwrite
|
|
193
343
|
.gsub('{teamId}', team_id)
|
194
344
|
.gsub('{membershipId}', membership_id)
|
195
345
|
|
196
|
-
params = {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
346
|
+
params = {
|
347
|
+
roles: roles,
|
348
|
+
}
|
349
|
+
|
350
|
+
headers = {
|
351
|
+
"content-type": 'application/json',
|
352
|
+
}
|
353
|
+
|
354
|
+
@client.call(
|
355
|
+
method: 'PATCH',
|
356
|
+
path: path,
|
357
|
+
params: params,
|
358
|
+
headers: headers,
|
359
|
+
response_type: Membership
|
360
|
+
)
|
205
361
|
end
|
206
362
|
|
363
|
+
# This endpoint allows a user to leave a team or for a team owner to delete
|
364
|
+
# the membership of any other team member. You can also use this endpoint to
|
365
|
+
# delete a user membership even if it is not accepted.
|
366
|
+
#
|
367
|
+
# @param [string] team_id Team ID.
|
368
|
+
# @param [string] membership_id Membership ID.
|
369
|
+
#
|
370
|
+
# @return []
|
207
371
|
def delete_membership(team_id:, membership_id:)
|
208
372
|
if team_id.nil?
|
209
373
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -217,13 +381,31 @@ module Appwrite
|
|
217
381
|
.gsub('{teamId}', team_id)
|
218
382
|
.gsub('{membershipId}', membership_id)
|
219
383
|
|
220
|
-
params = {
|
384
|
+
params = {
|
385
|
+
}
|
386
|
+
|
387
|
+
headers = {
|
388
|
+
"content-type": 'application/json',
|
389
|
+
}
|
221
390
|
|
222
|
-
|
223
|
-
|
224
|
-
|
391
|
+
@client.call(
|
392
|
+
method: 'DELETE',
|
393
|
+
path: path,
|
394
|
+
params: params,
|
395
|
+
headers: headers,
|
396
|
+
)
|
225
397
|
end
|
226
398
|
|
399
|
+
# Use this endpoint to allow a user to accept an invitation to join a team
|
400
|
+
# after being redirected back to your app from the invitation email received
|
401
|
+
# by the user.
|
402
|
+
#
|
403
|
+
# @param [string] team_id Team ID.
|
404
|
+
# @param [string] membership_id Membership ID.
|
405
|
+
# @param [string] user_id User ID.
|
406
|
+
# @param [string] secret Secret key.
|
407
|
+
#
|
408
|
+
# @return [Membership]
|
227
409
|
def update_membership_status(team_id:, membership_id:, user_id:, secret:)
|
228
410
|
if team_id.nil?
|
229
411
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -245,24 +427,23 @@ module Appwrite
|
|
245
427
|
.gsub('{teamId}', team_id)
|
246
428
|
.gsub('{membershipId}', membership_id)
|
247
429
|
|
248
|
-
params = {
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
430
|
+
params = {
|
431
|
+
userId: user_id,
|
432
|
+
secret: secret,
|
433
|
+
}
|
434
|
+
|
435
|
+
headers = {
|
436
|
+
"content-type": 'application/json',
|
437
|
+
}
|
438
|
+
|
439
|
+
@client.call(
|
440
|
+
method: 'PATCH',
|
441
|
+
path: path,
|
442
|
+
params: params,
|
443
|
+
headers: headers,
|
444
|
+
response_type: Membership
|
445
|
+
)
|
261
446
|
end
|
262
447
|
|
263
|
-
|
264
|
-
protected
|
265
|
-
|
266
|
-
private
|
267
448
|
end
|
268
449
|
end
|