torii-backend 0.0.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 +7 -0
- data/README.md +120 -0
- data/spec/server-v1.json +1 -0
- data/src/torii/backend/auth.rb +28 -0
- data/src/torii/backend/authenticate_request.rb +56 -0
- data/src/torii/backend/client.rb +232 -0
- data/src/torii/backend/errors.rb +34 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/api/server_sessions_api.rb +217 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/api/server_users_api.rb +486 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/api_client.rb +396 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/api_error.rb +58 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/api_model_base.rb +88 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/configuration.rb +301 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/create_user_request.rb +205 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/cursor_page_response_user_response.rb +206 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/problem_detail.rb +194 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/server_user_search_request.rb +217 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/update_user_request.rb +228 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/user_response.rb +387 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/models/user_session_response.rb +323 -0
- data/src/torii/backend/generated/lib/torii-backend-generated/version.rb +15 -0
- data/src/torii/backend/generated/lib/torii-backend-generated.rb +49 -0
- data/src/torii/backend/patch.rb +23 -0
- data/src/torii/backend/rack.rb +69 -0
- data/src/torii/backend/verify.rb +162 -0
- data/src/torii/backend/version.rb +7 -0
- data/src/torii/backend/webhook.rb +19 -0
- data/src/torii/backend.rb +22 -0
- data/src/torii-backend-generated.rb +26 -0
- metadata +163 -0
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#OpenAPI definition
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: v0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module ToriiBackendGenerated
|
|
16
|
+
class ServerUsersApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Ban user
|
|
23
|
+
# Marks the user as banned and revokes all their active sessions.
|
|
24
|
+
# @param user_id [String] Identifier of the user to ban.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [UserResponse]
|
|
27
|
+
def ban_user(user_id, opts = {})
|
|
28
|
+
data, _status_code, _headers = ban_user_with_http_info(user_id, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Ban user
|
|
33
|
+
# Marks the user as banned and revokes all their active sessions.
|
|
34
|
+
# @param user_id [String] Identifier of the user to ban.
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
|
37
|
+
def ban_user_with_http_info(user_id, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.ban_user ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'user_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ServerUsersApi.ban_user"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/api/server/v1/users/{userId}/ban'.sub('{userId}', CGI.escape(user_id.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || []
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"ServerUsersApi.ban_user",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#ban_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Create user
|
|
86
|
+
# Creates an end-user in your environment. All body fields are optional; supply at minimum an email if you want the user to be able to sign in via email + password.
|
|
87
|
+
# @param create_user_request [CreateUserRequest]
|
|
88
|
+
# @param [Hash] opts the optional parameters
|
|
89
|
+
# @return [UserResponse]
|
|
90
|
+
def create_user(create_user_request, opts = {})
|
|
91
|
+
data, _status_code, _headers = create_user_with_http_info(create_user_request, opts)
|
|
92
|
+
data
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Create user
|
|
96
|
+
# Creates an end-user in your environment. All body fields are optional; supply at minimum an email if you want the user to be able to sign in via email + password.
|
|
97
|
+
# @param create_user_request [CreateUserRequest]
|
|
98
|
+
# @param [Hash] opts the optional parameters
|
|
99
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
|
100
|
+
def create_user_with_http_info(create_user_request, opts = {})
|
|
101
|
+
if @api_client.config.debugging
|
|
102
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.create_user ...'
|
|
103
|
+
end
|
|
104
|
+
# verify the required parameter 'create_user_request' is set
|
|
105
|
+
if @api_client.config.client_side_validation && create_user_request.nil?
|
|
106
|
+
fail ArgumentError, "Missing the required parameter 'create_user_request' when calling ServerUsersApi.create_user"
|
|
107
|
+
end
|
|
108
|
+
# resource path
|
|
109
|
+
local_var_path = '/api/server/v1/users'
|
|
110
|
+
|
|
111
|
+
# query parameters
|
|
112
|
+
query_params = opts[:query_params] || {}
|
|
113
|
+
|
|
114
|
+
# header parameters
|
|
115
|
+
header_params = opts[:header_params] || {}
|
|
116
|
+
# HTTP header 'Accept' (if needed)
|
|
117
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
118
|
+
# HTTP header 'Content-Type'
|
|
119
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
120
|
+
if !content_type.nil?
|
|
121
|
+
header_params['Content-Type'] = content_type
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# form parameters
|
|
125
|
+
form_params = opts[:form_params] || {}
|
|
126
|
+
|
|
127
|
+
# http body (model)
|
|
128
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_user_request)
|
|
129
|
+
|
|
130
|
+
# return_type
|
|
131
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
|
132
|
+
|
|
133
|
+
# auth_names
|
|
134
|
+
auth_names = opts[:debug_auth_names] || []
|
|
135
|
+
|
|
136
|
+
new_options = opts.merge(
|
|
137
|
+
:operation => :"ServerUsersApi.create_user",
|
|
138
|
+
:header_params => header_params,
|
|
139
|
+
:query_params => query_params,
|
|
140
|
+
:form_params => form_params,
|
|
141
|
+
:body => post_body,
|
|
142
|
+
:auth_names => auth_names,
|
|
143
|
+
:return_type => return_type
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
147
|
+
if @api_client.config.debugging
|
|
148
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
149
|
+
end
|
|
150
|
+
return data, status_code, headers
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Delete user
|
|
154
|
+
# Soft-deletes the user. Not idempotent at the HTTP layer: the authorization grant for the user is revoked on the first successful delete, so a subsequent DELETE for the same id returns 403 rather than 204. Treat 403 from a retry as a confirmation that the user is already deleted.
|
|
155
|
+
# @param user_id [String] Identifier of the user to delete.
|
|
156
|
+
# @param [Hash] opts the optional parameters
|
|
157
|
+
# @return [nil]
|
|
158
|
+
def delete_user(user_id, opts = {})
|
|
159
|
+
delete_user_with_http_info(user_id, opts)
|
|
160
|
+
nil
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Delete user
|
|
164
|
+
# Soft-deletes the user. Not idempotent at the HTTP layer: the authorization grant for the user is revoked on the first successful delete, so a subsequent DELETE for the same id returns 403 rather than 204. Treat 403 from a retry as a confirmation that the user is already deleted.
|
|
165
|
+
# @param user_id [String] Identifier of the user to delete.
|
|
166
|
+
# @param [Hash] opts the optional parameters
|
|
167
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
168
|
+
def delete_user_with_http_info(user_id, opts = {})
|
|
169
|
+
if @api_client.config.debugging
|
|
170
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.delete_user ...'
|
|
171
|
+
end
|
|
172
|
+
# verify the required parameter 'user_id' is set
|
|
173
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
174
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ServerUsersApi.delete_user"
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = '/api/server/v1/users/{userId}'.sub('{userId}', CGI.escape(user_id.to_s))
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = opts[:query_params] || {}
|
|
181
|
+
|
|
182
|
+
# header parameters
|
|
183
|
+
header_params = opts[:header_params] || {}
|
|
184
|
+
# HTTP header 'Accept' (if needed)
|
|
185
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/problem+json']) unless header_params['Accept']
|
|
186
|
+
|
|
187
|
+
# form parameters
|
|
188
|
+
form_params = opts[:form_params] || {}
|
|
189
|
+
|
|
190
|
+
# http body (model)
|
|
191
|
+
post_body = opts[:debug_body]
|
|
192
|
+
|
|
193
|
+
# return_type
|
|
194
|
+
return_type = opts[:debug_return_type]
|
|
195
|
+
|
|
196
|
+
# auth_names
|
|
197
|
+
auth_names = opts[:debug_auth_names] || []
|
|
198
|
+
|
|
199
|
+
new_options = opts.merge(
|
|
200
|
+
:operation => :"ServerUsersApi.delete_user",
|
|
201
|
+
:header_params => header_params,
|
|
202
|
+
:query_params => query_params,
|
|
203
|
+
:form_params => form_params,
|
|
204
|
+
:body => post_body,
|
|
205
|
+
:auth_names => auth_names,
|
|
206
|
+
:return_type => return_type
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
210
|
+
if @api_client.config.debugging
|
|
211
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
212
|
+
end
|
|
213
|
+
return data, status_code, headers
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Get user
|
|
217
|
+
# Returns the full profile for one end-user.
|
|
218
|
+
# @param user_id [String] Identifier of the user to fetch.
|
|
219
|
+
# @param [Hash] opts the optional parameters
|
|
220
|
+
# @return [UserResponse]
|
|
221
|
+
def get_user(user_id, opts = {})
|
|
222
|
+
data, _status_code, _headers = get_user_with_http_info(user_id, opts)
|
|
223
|
+
data
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Get user
|
|
227
|
+
# Returns the full profile for one end-user.
|
|
228
|
+
# @param user_id [String] Identifier of the user to fetch.
|
|
229
|
+
# @param [Hash] opts the optional parameters
|
|
230
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
|
231
|
+
def get_user_with_http_info(user_id, opts = {})
|
|
232
|
+
if @api_client.config.debugging
|
|
233
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.get_user ...'
|
|
234
|
+
end
|
|
235
|
+
# verify the required parameter 'user_id' is set
|
|
236
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
237
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ServerUsersApi.get_user"
|
|
238
|
+
end
|
|
239
|
+
# resource path
|
|
240
|
+
local_var_path = '/api/server/v1/users/{userId}'.sub('{userId}', CGI.escape(user_id.to_s))
|
|
241
|
+
|
|
242
|
+
# query parameters
|
|
243
|
+
query_params = opts[:query_params] || {}
|
|
244
|
+
|
|
245
|
+
# header parameters
|
|
246
|
+
header_params = opts[:header_params] || {}
|
|
247
|
+
# HTTP header 'Accept' (if needed)
|
|
248
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
249
|
+
|
|
250
|
+
# form parameters
|
|
251
|
+
form_params = opts[:form_params] || {}
|
|
252
|
+
|
|
253
|
+
# http body (model)
|
|
254
|
+
post_body = opts[:debug_body]
|
|
255
|
+
|
|
256
|
+
# return_type
|
|
257
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
|
258
|
+
|
|
259
|
+
# auth_names
|
|
260
|
+
auth_names = opts[:debug_auth_names] || []
|
|
261
|
+
|
|
262
|
+
new_options = opts.merge(
|
|
263
|
+
:operation => :"ServerUsersApi.get_user",
|
|
264
|
+
:header_params => header_params,
|
|
265
|
+
:query_params => query_params,
|
|
266
|
+
:form_params => form_params,
|
|
267
|
+
:body => post_body,
|
|
268
|
+
:auth_names => auth_names,
|
|
269
|
+
:return_type => return_type
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
273
|
+
if @api_client.config.debugging
|
|
274
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
275
|
+
end
|
|
276
|
+
return data, status_code, headers
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Search users
|
|
280
|
+
# Returns a cursor-paginated page of end-users in the environment matching the optional filters. Filters use the same tri-state PATCH semantics as `UpdateUserRequest`: omit a field to skip that filter, send a value to require it, send null to require null. Uses POST so the filter body can be sent without URL-encoding.
|
|
281
|
+
# @param [Hash] opts the optional parameters
|
|
282
|
+
# @option opts [Integer] :limit Maximum number of items in the returned page (default 20). (default to 20)
|
|
283
|
+
# @option opts [String] :cursor Opaque cursor returned by the previous page's `nextCursor`. Omit to fetch the first page.
|
|
284
|
+
# @option opts [ServerUserSearchRequest] :server_user_search_request
|
|
285
|
+
# @return [CursorPageResponseUserResponse]
|
|
286
|
+
def search_users(opts = {})
|
|
287
|
+
data, _status_code, _headers = search_users_with_http_info(opts)
|
|
288
|
+
data
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Search users
|
|
292
|
+
# Returns a cursor-paginated page of end-users in the environment matching the optional filters. Filters use the same tri-state PATCH semantics as `UpdateUserRequest`: omit a field to skip that filter, send a value to require it, send null to require null. Uses POST so the filter body can be sent without URL-encoding.
|
|
293
|
+
# @param [Hash] opts the optional parameters
|
|
294
|
+
# @option opts [Integer] :limit Maximum number of items in the returned page (default 20). (default to 20)
|
|
295
|
+
# @option opts [String] :cursor Opaque cursor returned by the previous page's `nextCursor`. Omit to fetch the first page.
|
|
296
|
+
# @option opts [ServerUserSearchRequest] :server_user_search_request
|
|
297
|
+
# @return [Array<(CursorPageResponseUserResponse, Integer, Hash)>] CursorPageResponseUserResponse data, response status code and response headers
|
|
298
|
+
def search_users_with_http_info(opts = {})
|
|
299
|
+
if @api_client.config.debugging
|
|
300
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.search_users ...'
|
|
301
|
+
end
|
|
302
|
+
# resource path
|
|
303
|
+
local_var_path = '/api/server/v1/users/search'
|
|
304
|
+
|
|
305
|
+
# query parameters
|
|
306
|
+
query_params = opts[:query_params] || {}
|
|
307
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
308
|
+
query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
|
|
309
|
+
|
|
310
|
+
# header parameters
|
|
311
|
+
header_params = opts[:header_params] || {}
|
|
312
|
+
# HTTP header 'Accept' (if needed)
|
|
313
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
314
|
+
# HTTP header 'Content-Type'
|
|
315
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
316
|
+
if !content_type.nil?
|
|
317
|
+
header_params['Content-Type'] = content_type
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
# form parameters
|
|
321
|
+
form_params = opts[:form_params] || {}
|
|
322
|
+
|
|
323
|
+
# http body (model)
|
|
324
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_user_search_request'])
|
|
325
|
+
|
|
326
|
+
# return_type
|
|
327
|
+
return_type = opts[:debug_return_type] || 'CursorPageResponseUserResponse'
|
|
328
|
+
|
|
329
|
+
# auth_names
|
|
330
|
+
auth_names = opts[:debug_auth_names] || []
|
|
331
|
+
|
|
332
|
+
new_options = opts.merge(
|
|
333
|
+
:operation => :"ServerUsersApi.search_users",
|
|
334
|
+
:header_params => header_params,
|
|
335
|
+
:query_params => query_params,
|
|
336
|
+
:form_params => form_params,
|
|
337
|
+
:body => post_body,
|
|
338
|
+
:auth_names => auth_names,
|
|
339
|
+
:return_type => return_type
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
343
|
+
if @api_client.config.debugging
|
|
344
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#search_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
345
|
+
end
|
|
346
|
+
return data, status_code, headers
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Unban user
|
|
350
|
+
# Reverses a previous ban. The user can sign in again on next request.
|
|
351
|
+
# @param user_id [String] Identifier of the user to unban.
|
|
352
|
+
# @param [Hash] opts the optional parameters
|
|
353
|
+
# @return [UserResponse]
|
|
354
|
+
def unban_user(user_id, opts = {})
|
|
355
|
+
data, _status_code, _headers = unban_user_with_http_info(user_id, opts)
|
|
356
|
+
data
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# Unban user
|
|
360
|
+
# Reverses a previous ban. The user can sign in again on next request.
|
|
361
|
+
# @param user_id [String] Identifier of the user to unban.
|
|
362
|
+
# @param [Hash] opts the optional parameters
|
|
363
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
|
364
|
+
def unban_user_with_http_info(user_id, opts = {})
|
|
365
|
+
if @api_client.config.debugging
|
|
366
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.unban_user ...'
|
|
367
|
+
end
|
|
368
|
+
# verify the required parameter 'user_id' is set
|
|
369
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
370
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ServerUsersApi.unban_user"
|
|
371
|
+
end
|
|
372
|
+
# resource path
|
|
373
|
+
local_var_path = '/api/server/v1/users/{userId}/unban'.sub('{userId}', CGI.escape(user_id.to_s))
|
|
374
|
+
|
|
375
|
+
# query parameters
|
|
376
|
+
query_params = opts[:query_params] || {}
|
|
377
|
+
|
|
378
|
+
# header parameters
|
|
379
|
+
header_params = opts[:header_params] || {}
|
|
380
|
+
# HTTP header 'Accept' (if needed)
|
|
381
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
382
|
+
|
|
383
|
+
# form parameters
|
|
384
|
+
form_params = opts[:form_params] || {}
|
|
385
|
+
|
|
386
|
+
# http body (model)
|
|
387
|
+
post_body = opts[:debug_body]
|
|
388
|
+
|
|
389
|
+
# return_type
|
|
390
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
|
391
|
+
|
|
392
|
+
# auth_names
|
|
393
|
+
auth_names = opts[:debug_auth_names] || []
|
|
394
|
+
|
|
395
|
+
new_options = opts.merge(
|
|
396
|
+
:operation => :"ServerUsersApi.unban_user",
|
|
397
|
+
:header_params => header_params,
|
|
398
|
+
:query_params => query_params,
|
|
399
|
+
:form_params => form_params,
|
|
400
|
+
:body => post_body,
|
|
401
|
+
:auth_names => auth_names,
|
|
402
|
+
:return_type => return_type
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
406
|
+
if @api_client.config.debugging
|
|
407
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#unban_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
408
|
+
end
|
|
409
|
+
return data, status_code, headers
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
# Update user
|
|
413
|
+
# Partial update with tri-state PATCH semantics. Every field in `UpdateUserRequest` is tri-state: omit the key to leave the field unchanged, send a non-null value to set it, or send JSON null to clear it.
|
|
414
|
+
# @param user_id [String] Identifier of the user to update.
|
|
415
|
+
# @param update_user_request [UpdateUserRequest]
|
|
416
|
+
# @param [Hash] opts the optional parameters
|
|
417
|
+
# @return [UserResponse]
|
|
418
|
+
def update_user(user_id, update_user_request, opts = {})
|
|
419
|
+
data, _status_code, _headers = update_user_with_http_info(user_id, update_user_request, opts)
|
|
420
|
+
data
|
|
421
|
+
end
|
|
422
|
+
|
|
423
|
+
# Update user
|
|
424
|
+
# Partial update with tri-state PATCH semantics. Every field in `UpdateUserRequest` is tri-state: omit the key to leave the field unchanged, send a non-null value to set it, or send JSON null to clear it.
|
|
425
|
+
# @param user_id [String] Identifier of the user to update.
|
|
426
|
+
# @param update_user_request [UpdateUserRequest]
|
|
427
|
+
# @param [Hash] opts the optional parameters
|
|
428
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
|
429
|
+
def update_user_with_http_info(user_id, update_user_request, opts = {})
|
|
430
|
+
if @api_client.config.debugging
|
|
431
|
+
@api_client.config.logger.debug 'Calling API: ServerUsersApi.update_user ...'
|
|
432
|
+
end
|
|
433
|
+
# verify the required parameter 'user_id' is set
|
|
434
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
435
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ServerUsersApi.update_user"
|
|
436
|
+
end
|
|
437
|
+
# verify the required parameter 'update_user_request' is set
|
|
438
|
+
if @api_client.config.client_side_validation && update_user_request.nil?
|
|
439
|
+
fail ArgumentError, "Missing the required parameter 'update_user_request' when calling ServerUsersApi.update_user"
|
|
440
|
+
end
|
|
441
|
+
# resource path
|
|
442
|
+
local_var_path = '/api/server/v1/users/{userId}'.sub('{userId}', CGI.escape(user_id.to_s))
|
|
443
|
+
|
|
444
|
+
# query parameters
|
|
445
|
+
query_params = opts[:query_params] || {}
|
|
446
|
+
|
|
447
|
+
# header parameters
|
|
448
|
+
header_params = opts[:header_params] || {}
|
|
449
|
+
# HTTP header 'Accept' (if needed)
|
|
450
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json']) unless header_params['Accept']
|
|
451
|
+
# HTTP header 'Content-Type'
|
|
452
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
453
|
+
if !content_type.nil?
|
|
454
|
+
header_params['Content-Type'] = content_type
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
# form parameters
|
|
458
|
+
form_params = opts[:form_params] || {}
|
|
459
|
+
|
|
460
|
+
# http body (model)
|
|
461
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request)
|
|
462
|
+
|
|
463
|
+
# return_type
|
|
464
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
|
465
|
+
|
|
466
|
+
# auth_names
|
|
467
|
+
auth_names = opts[:debug_auth_names] || []
|
|
468
|
+
|
|
469
|
+
new_options = opts.merge(
|
|
470
|
+
:operation => :"ServerUsersApi.update_user",
|
|
471
|
+
:header_params => header_params,
|
|
472
|
+
:query_params => query_params,
|
|
473
|
+
:form_params => form_params,
|
|
474
|
+
:body => post_body,
|
|
475
|
+
:auth_names => auth_names,
|
|
476
|
+
:return_type => return_type
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
480
|
+
if @api_client.config.debugging
|
|
481
|
+
@api_client.config.logger.debug "API called: ServerUsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
482
|
+
end
|
|
483
|
+
return data, status_code, headers
|
|
484
|
+
end
|
|
485
|
+
end
|
|
486
|
+
end
|