appwrite 2.4.0 → 4.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 +197 -56
- data/lib/appwrite/exception.rb +7 -7
- data/lib/appwrite/file.rb +9 -15
- 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/bucket.rb +82 -0
- data/lib/appwrite/models/bucket_list.rb +32 -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/deployment.rb +77 -0
- data/lib/appwrite/models/deployment_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 +77 -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 +142 -0
- data/lib/appwrite/models/session_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 +400 -138
- data/lib/appwrite/services/avatars.rb +188 -125
- data/lib/appwrite/services/database.rb +875 -130
- data/lib/appwrite/services/functions.rb +439 -207
- data/lib/appwrite/services/health.rb +201 -58
- data/lib/appwrite/services/locale.rb +133 -32
- data/lib/appwrite/services/storage.rb +469 -118
- data/lib/appwrite/services/teams.rb +302 -118
- data/lib/appwrite/services/users.rb +322 -127
- data/lib/appwrite.rb +57 -0
- metadata +74 -108
- data/.travis.yml +0 -16
- data/CHANGELOG.md +0 -1
- data/Gemfile +0 -4
- data/LICENSE +0 -12
- data/README.md +0 -96
- 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-session.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-email.md +0 -15
- data/docs/examples/users/update-name.md +0 -15
- data/docs/examples/users/update-password.md +0 -15
- data/docs/examples/users/update-prefs.md +0 -15
- data/docs/examples/users/update-status.md +0 -15
- data/docs/examples/users/update-verification.md +0 -15
@@ -1,54 +1,91 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
1
3
|
module Appwrite
|
2
4
|
class Teams < Service
|
3
5
|
|
4
|
-
|
6
|
+
# Get a list of all the teams in which the current user is a member. You can
|
7
|
+
# use the parameters to filter your results.
|
8
|
+
#
|
9
|
+
# In admin mode, this endpoint returns a list of all the teams in the current
|
10
|
+
# project. [Learn more about different API modes](/docs/admin).
|
11
|
+
#
|
12
|
+
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
13
|
+
# @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.
|
14
|
+
# @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)
|
15
|
+
# @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)
|
16
|
+
# @param [string] cursor_direction Direction of the cursor.
|
17
|
+
# @param [string] order_type Order result by ASC or DESC order.
|
18
|
+
#
|
19
|
+
# @return [TeamList]
|
20
|
+
def list(search: nil, limit: nil, offset: nil, cursor: nil, cursor_direction: nil, order_type: nil)
|
5
21
|
path = '/teams'
|
6
22
|
|
7
|
-
params = {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
params = {
|
24
|
+
search: search,
|
25
|
+
limit: limit,
|
26
|
+
offset: offset,
|
27
|
+
cursor: cursor,
|
28
|
+
cursorDirection: cursor_direction,
|
29
|
+
orderType: order_type,
|
30
|
+
}
|
31
|
+
|
32
|
+
headers = {
|
33
|
+
"content-type": 'application/json',
|
34
|
+
}
|
35
|
+
|
36
|
+
@client.call(
|
37
|
+
method: 'GET',
|
38
|
+
path: path,
|
39
|
+
headers: headers,
|
40
|
+
params: params,
|
41
|
+
response_type: Models::TeamList
|
42
|
+
)
|
43
|
+
end
|
20
44
|
|
21
|
-
|
22
|
-
|
45
|
+
# Create a new team. The user who creates the team will automatically be
|
46
|
+
# assigned as the owner of the team. Only the users with the owner role can
|
47
|
+
# invite new members, add new owners and delete or update the team.
|
48
|
+
#
|
49
|
+
# @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.
|
50
|
+
# @param [string] name Team name. Max length: 128 chars.
|
51
|
+
# @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.
|
52
|
+
#
|
53
|
+
# @return [Team]
|
54
|
+
def create(team_id:, name:, roles: nil)
|
55
|
+
if team_id.nil?
|
56
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
23
57
|
end
|
24
58
|
|
25
|
-
return @client.call('get', path, {
|
26
|
-
'content-type' => 'application/json',
|
27
|
-
}, params);
|
28
|
-
end
|
29
|
-
|
30
|
-
def create(name:, roles: nil)
|
31
59
|
if name.nil?
|
32
60
|
raise Appwrite::Exception.new('Missing required parameter: "name"')
|
33
61
|
end
|
34
62
|
|
35
63
|
path = '/teams'
|
36
64
|
|
37
|
-
params = {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
65
|
+
params = {
|
66
|
+
teamId: team_id,
|
67
|
+
name: name,
|
68
|
+
roles: roles,
|
69
|
+
}
|
70
|
+
|
71
|
+
headers = {
|
72
|
+
"content-type": 'application/json',
|
73
|
+
}
|
74
|
+
|
75
|
+
@client.call(
|
76
|
+
method: 'POST',
|
77
|
+
path: path,
|
78
|
+
headers: headers,
|
79
|
+
params: params,
|
80
|
+
response_type: Models::Team
|
81
|
+
)
|
50
82
|
end
|
51
83
|
|
84
|
+
# Get a team by its ID. All team members have read access for this resource.
|
85
|
+
#
|
86
|
+
# @param [string] team_id Team ID.
|
87
|
+
#
|
88
|
+
# @return [Team]
|
52
89
|
def get(team_id:)
|
53
90
|
if team_id.nil?
|
54
91
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -57,13 +94,29 @@ module Appwrite
|
|
57
94
|
path = '/teams/{teamId}'
|
58
95
|
.gsub('{teamId}', team_id)
|
59
96
|
|
60
|
-
params = {
|
97
|
+
params = {
|
98
|
+
}
|
99
|
+
|
100
|
+
headers = {
|
101
|
+
"content-type": 'application/json',
|
102
|
+
}
|
61
103
|
|
62
|
-
|
63
|
-
|
64
|
-
|
104
|
+
@client.call(
|
105
|
+
method: 'GET',
|
106
|
+
path: path,
|
107
|
+
headers: headers,
|
108
|
+
params: params,
|
109
|
+
response_type: Models::Team
|
110
|
+
)
|
65
111
|
end
|
66
112
|
|
113
|
+
# Update a team using its ID. Only members with the owner role can update the
|
114
|
+
# team.
|
115
|
+
#
|
116
|
+
# @param [string] team_id Team ID.
|
117
|
+
# @param [string] name New team name. Max length: 128 chars.
|
118
|
+
#
|
119
|
+
# @return [Team]
|
67
120
|
def update(team_id:, name:)
|
68
121
|
if team_id.nil?
|
69
122
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -76,17 +129,29 @@ module Appwrite
|
|
76
129
|
path = '/teams/{teamId}'
|
77
130
|
.gsub('{teamId}', team_id)
|
78
131
|
|
79
|
-
params = {
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
132
|
+
params = {
|
133
|
+
name: name,
|
134
|
+
}
|
135
|
+
|
136
|
+
headers = {
|
137
|
+
"content-type": 'application/json',
|
138
|
+
}
|
139
|
+
|
140
|
+
@client.call(
|
141
|
+
method: 'PUT',
|
142
|
+
path: path,
|
143
|
+
headers: headers,
|
144
|
+
params: params,
|
145
|
+
response_type: Models::Team
|
146
|
+
)
|
88
147
|
end
|
89
148
|
|
149
|
+
# Delete a team using its ID. Only team members with the owner role can
|
150
|
+
# delete the team.
|
151
|
+
#
|
152
|
+
# @param [string] team_id Team ID.
|
153
|
+
#
|
154
|
+
# @return []
|
90
155
|
def delete(team_id:)
|
91
156
|
if team_id.nil?
|
92
157
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -95,14 +160,34 @@ module Appwrite
|
|
95
160
|
path = '/teams/{teamId}'
|
96
161
|
.gsub('{teamId}', team_id)
|
97
162
|
|
98
|
-
params = {
|
163
|
+
params = {
|
164
|
+
}
|
99
165
|
|
100
|
-
|
101
|
-
|
102
|
-
}
|
166
|
+
headers = {
|
167
|
+
"content-type": 'application/json',
|
168
|
+
}
|
169
|
+
|
170
|
+
@client.call(
|
171
|
+
method: 'DELETE',
|
172
|
+
path: path,
|
173
|
+
headers: headers,
|
174
|
+
params: params,
|
175
|
+
)
|
103
176
|
end
|
104
177
|
|
105
|
-
|
178
|
+
# Use this endpoint to list a team's members using the team's ID. All team
|
179
|
+
# members have read access to this endpoint.
|
180
|
+
#
|
181
|
+
# @param [string] team_id Team ID.
|
182
|
+
# @param [string] search Search term to filter your list results. Max length: 256 chars.
|
183
|
+
# @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.
|
184
|
+
# @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)
|
185
|
+
# @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)
|
186
|
+
# @param [string] cursor_direction Direction of the cursor.
|
187
|
+
# @param [string] order_type Order result by ASC or DESC order.
|
188
|
+
#
|
189
|
+
# @return [MembershipList]
|
190
|
+
def get_memberships(team_id:, search: nil, limit: nil, offset: nil, cursor: nil, cursor_direction: nil, order_type: nil)
|
106
191
|
if team_id.nil?
|
107
192
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
108
193
|
end
|
@@ -110,29 +195,51 @@ module Appwrite
|
|
110
195
|
path = '/teams/{teamId}/memberships'
|
111
196
|
.gsub('{teamId}', team_id)
|
112
197
|
|
113
|
-
params = {
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
}, params);
|
198
|
+
params = {
|
199
|
+
search: search,
|
200
|
+
limit: limit,
|
201
|
+
offset: offset,
|
202
|
+
cursor: cursor,
|
203
|
+
cursorDirection: cursor_direction,
|
204
|
+
orderType: order_type,
|
205
|
+
}
|
206
|
+
|
207
|
+
headers = {
|
208
|
+
"content-type": 'application/json',
|
209
|
+
}
|
210
|
+
|
211
|
+
@client.call(
|
212
|
+
method: 'GET',
|
213
|
+
path: path,
|
214
|
+
headers: headers,
|
215
|
+
params: params,
|
216
|
+
response_type: Models::MembershipList
|
217
|
+
)
|
134
218
|
end
|
135
219
|
|
220
|
+
# Invite a new member to join your team. If initiated from the client SDK, an
|
221
|
+
# email with a link to join the team will be sent to the member's email
|
222
|
+
# address and an account will be created for them should they not be signed
|
223
|
+
# up already. If initiated from server-side SDKs, the new member will
|
224
|
+
# automatically be added to the team.
|
225
|
+
#
|
226
|
+
# Use the 'url' parameter to redirect the user from the invitation email back
|
227
|
+
# to your app. When the user is redirected, use the [Update Team Membership
|
228
|
+
# Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
|
229
|
+
# the user to accept the invitation to the team.
|
230
|
+
#
|
231
|
+
# Please note that to avoid a [Redirect
|
232
|
+
# Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
233
|
+
# the only valid redirect URL's are the once from domains you have set when
|
234
|
+
# adding your platforms in the console interface.
|
235
|
+
#
|
236
|
+
# @param [string] team_id Team ID.
|
237
|
+
# @param [string] email Email of the new team member.
|
238
|
+
# @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.
|
239
|
+
# @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.
|
240
|
+
# @param [string] name Name of the new team member. Max length: 128 chars.
|
241
|
+
#
|
242
|
+
# @return [Membership]
|
136
243
|
def create_membership(team_id:, email:, roles:, url:, name: nil)
|
137
244
|
if team_id.nil?
|
138
245
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -153,29 +260,71 @@ module Appwrite
|
|
153
260
|
path = '/teams/{teamId}/memberships'
|
154
261
|
.gsub('{teamId}', team_id)
|
155
262
|
|
156
|
-
params = {
|
263
|
+
params = {
|
264
|
+
email: email,
|
265
|
+
roles: roles,
|
266
|
+
url: url,
|
267
|
+
name: name,
|
268
|
+
}
|
269
|
+
|
270
|
+
headers = {
|
271
|
+
"content-type": 'application/json',
|
272
|
+
}
|
273
|
+
|
274
|
+
@client.call(
|
275
|
+
method: 'POST',
|
276
|
+
path: path,
|
277
|
+
headers: headers,
|
278
|
+
params: params,
|
279
|
+
response_type: Models::Membership
|
280
|
+
)
|
281
|
+
end
|
157
282
|
|
158
|
-
|
159
|
-
|
283
|
+
# Get a team member by the membership unique id. All team members have read
|
284
|
+
# access for this resource.
|
285
|
+
#
|
286
|
+
# @param [string] team_id Team ID.
|
287
|
+
# @param [string] membership_id Membership ID.
|
288
|
+
#
|
289
|
+
# @return [MembershipList]
|
290
|
+
def get_membership(team_id:, membership_id:)
|
291
|
+
if team_id.nil?
|
292
|
+
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
160
293
|
end
|
161
294
|
|
162
|
-
if
|
163
|
-
|
295
|
+
if membership_id.nil?
|
296
|
+
raise Appwrite::Exception.new('Missing required parameter: "membershipId"')
|
164
297
|
end
|
165
298
|
|
166
|
-
|
167
|
-
|
168
|
-
|
299
|
+
path = '/teams/{teamId}/memberships/{membershipId}'
|
300
|
+
.gsub('{teamId}', team_id)
|
301
|
+
.gsub('{membershipId}', membership_id)
|
169
302
|
|
170
|
-
|
171
|
-
|
172
|
-
|
303
|
+
params = {
|
304
|
+
}
|
305
|
+
|
306
|
+
headers = {
|
307
|
+
"content-type": 'application/json',
|
308
|
+
}
|
173
309
|
|
174
|
-
|
175
|
-
|
176
|
-
|
310
|
+
@client.call(
|
311
|
+
method: 'GET',
|
312
|
+
path: path,
|
313
|
+
headers: headers,
|
314
|
+
params: params,
|
315
|
+
response_type: Models::MembershipList
|
316
|
+
)
|
177
317
|
end
|
178
318
|
|
319
|
+
# Modify the roles of a team member. Only team members with the owner role
|
320
|
+
# have access to this endpoint. Learn more about [roles and
|
321
|
+
# permissions](/docs/permissions).
|
322
|
+
#
|
323
|
+
# @param [string] team_id Team ID.
|
324
|
+
# @param [string] membership_id Membership ID.
|
325
|
+
# @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.
|
326
|
+
#
|
327
|
+
# @return [Membership]
|
179
328
|
def update_membership_roles(team_id:, membership_id:, roles:)
|
180
329
|
if team_id.nil?
|
181
330
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -193,17 +342,31 @@ module Appwrite
|
|
193
342
|
.gsub('{teamId}', team_id)
|
194
343
|
.gsub('{membershipId}', membership_id)
|
195
344
|
|
196
|
-
params = {
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
345
|
+
params = {
|
346
|
+
roles: roles,
|
347
|
+
}
|
348
|
+
|
349
|
+
headers = {
|
350
|
+
"content-type": 'application/json',
|
351
|
+
}
|
352
|
+
|
353
|
+
@client.call(
|
354
|
+
method: 'PATCH',
|
355
|
+
path: path,
|
356
|
+
headers: headers,
|
357
|
+
params: params,
|
358
|
+
response_type: Models::Membership
|
359
|
+
)
|
205
360
|
end
|
206
361
|
|
362
|
+
# This endpoint allows a user to leave a team or for a team owner to delete
|
363
|
+
# the membership of any other team member. You can also use this endpoint to
|
364
|
+
# delete a user membership even if it is not accepted.
|
365
|
+
#
|
366
|
+
# @param [string] team_id Team ID.
|
367
|
+
# @param [string] membership_id Membership ID.
|
368
|
+
#
|
369
|
+
# @return []
|
207
370
|
def delete_membership(team_id:, membership_id:)
|
208
371
|
if team_id.nil?
|
209
372
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -217,13 +380,35 @@ module Appwrite
|
|
217
380
|
.gsub('{teamId}', team_id)
|
218
381
|
.gsub('{membershipId}', membership_id)
|
219
382
|
|
220
|
-
params = {
|
383
|
+
params = {
|
384
|
+
}
|
385
|
+
|
386
|
+
headers = {
|
387
|
+
"content-type": 'application/json',
|
388
|
+
}
|
221
389
|
|
222
|
-
|
223
|
-
|
224
|
-
|
390
|
+
@client.call(
|
391
|
+
method: 'DELETE',
|
392
|
+
path: path,
|
393
|
+
headers: headers,
|
394
|
+
params: params,
|
395
|
+
)
|
225
396
|
end
|
226
397
|
|
398
|
+
# Use this endpoint to allow a user to accept an invitation to join a team
|
399
|
+
# after being redirected back to your app from the invitation email received
|
400
|
+
# by the user.
|
401
|
+
#
|
402
|
+
# If the request is successful, a session for the user is automatically
|
403
|
+
# created.
|
404
|
+
#
|
405
|
+
#
|
406
|
+
# @param [string] team_id Team ID.
|
407
|
+
# @param [string] membership_id Membership ID.
|
408
|
+
# @param [string] user_id User ID.
|
409
|
+
# @param [string] secret Secret key.
|
410
|
+
#
|
411
|
+
# @return [Membership]
|
227
412
|
def update_membership_status(team_id:, membership_id:, user_id:, secret:)
|
228
413
|
if team_id.nil?
|
229
414
|
raise Appwrite::Exception.new('Missing required parameter: "teamId"')
|
@@ -245,24 +430,23 @@ module Appwrite
|
|
245
430
|
.gsub('{teamId}', team_id)
|
246
431
|
.gsub('{membershipId}', membership_id)
|
247
432
|
|
248
|
-
params = {
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
433
|
+
params = {
|
434
|
+
userId: user_id,
|
435
|
+
secret: secret,
|
436
|
+
}
|
437
|
+
|
438
|
+
headers = {
|
439
|
+
"content-type": 'application/json',
|
440
|
+
}
|
441
|
+
|
442
|
+
@client.call(
|
443
|
+
method: 'PATCH',
|
444
|
+
path: path,
|
445
|
+
headers: headers,
|
446
|
+
params: params,
|
447
|
+
response_type: Models::Membership
|
448
|
+
)
|
261
449
|
end
|
262
450
|
|
263
|
-
|
264
|
-
protected
|
265
|
-
|
266
|
-
private
|
267
451
|
end
|
268
452
|
end
|