gopad 1.0.0
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/CHANGELOG.md +20 -0
- data/CONTRIBUTING.md +121 -0
- data/DCO +34 -0
- data/LICENSE +202 -0
- data/README.md +67 -0
- data/lib/gopad/api/auth_api.rb +154 -0
- data/lib/gopad/api/team_api.rb +671 -0
- data/lib/gopad/api/user_api.rb +671 -0
- data/lib/gopad/api_client.rb +429 -0
- data/lib/gopad/api_error.rb +56 -0
- data/lib/gopad/configuration.rb +390 -0
- data/lib/gopad/models/notification.rb +227 -0
- data/lib/gopad/models/team.rb +251 -0
- data/lib/gopad/models/team_user_params.rb +262 -0
- data/lib/gopad/models/team_users.rb +227 -0
- data/lib/gopad/models/teams.rb +220 -0
- data/lib/gopad/models/user.rb +299 -0
- data/lib/gopad/models/user_auth.rb +234 -0
- data/lib/gopad/models/user_team.rb +302 -0
- data/lib/gopad/models/user_team_params.rb +262 -0
- data/lib/gopad/models/user_teams.rb +227 -0
- data/lib/gopad/models/users.rb +220 -0
- data/lib/gopad/models/validation.rb +220 -0
- data/lib/gopad/version.rb +13 -0
- data/lib/gopad.rb +52 -0
- metadata +117 -0
@@ -0,0 +1,671 @@
|
|
1
|
+
# Gopad OpenAPI
|
2
|
+
#
|
3
|
+
# API definition for Gopad, Etherpad for markdown with go
|
4
|
+
#
|
5
|
+
# The version of the OpenAPI document: 1.0.0-alpha1
|
6
|
+
# Contact: gopad@webhippie.de
|
7
|
+
# Generated by: https://openapi-generator.tech
|
8
|
+
# Generator version: 7.6.0
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'cgi'
|
12
|
+
|
13
|
+
module Gopad
|
14
|
+
class TeamApi
|
15
|
+
attr_accessor :api_client
|
16
|
+
|
17
|
+
def initialize(api_client = ApiClient.default)
|
18
|
+
@api_client = api_client
|
19
|
+
end
|
20
|
+
|
21
|
+
# Assign a user to team
|
22
|
+
# @param team_id [String] A team identifier or slug
|
23
|
+
# @param team_user_params [TeamUserParams] The team user data to attach
|
24
|
+
# @param [Hash] opts the optional parameters
|
25
|
+
# @return [Notification]
|
26
|
+
def attach_team_to_user(team_id, team_user_params, opts = {})
|
27
|
+
data, _status_code, _headers = attach_team_to_user_with_http_info(team_id, team_user_params, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Assign a user to team
|
32
|
+
# @param team_id [String] A team identifier or slug
|
33
|
+
# @param team_user_params [TeamUserParams] The team user data to attach
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
|
36
|
+
def attach_team_to_user_with_http_info(team_id, team_user_params, opts = {})
|
37
|
+
if @api_client.config.debugging
|
38
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.attach_team_to_user ...'
|
39
|
+
end
|
40
|
+
# verify the required parameter 'team_id' is set
|
41
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
42
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.attach_team_to_user"
|
43
|
+
end
|
44
|
+
# verify the required parameter 'team_user_params' is set
|
45
|
+
if @api_client.config.client_side_validation && team_user_params.nil?
|
46
|
+
raise ArgumentError, "Missing the required parameter 'team_user_params' when calling TeamApi.attach_team_to_user"
|
47
|
+
end
|
48
|
+
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/teams/{team_id}/users'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
|
55
|
+
# header parameters
|
56
|
+
header_params = opts[:header_params] || {}
|
57
|
+
# HTTP header 'Accept' (if needed)
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
59
|
+
# HTTP header 'Content-Type'
|
60
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
61
|
+
unless content_type.nil?
|
62
|
+
header_params['Content-Type'] = content_type
|
63
|
+
end
|
64
|
+
|
65
|
+
# form parameters
|
66
|
+
form_params = opts[:form_params] || {}
|
67
|
+
|
68
|
+
# http body (model)
|
69
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(team_user_params)
|
70
|
+
|
71
|
+
# return_type
|
72
|
+
return_type = opts[:debug_return_type] || 'Notification'
|
73
|
+
|
74
|
+
# auth_names
|
75
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
76
|
+
|
77
|
+
new_options = opts.merge(
|
78
|
+
operation: :'TeamApi.attach_team_to_user',
|
79
|
+
header_params: header_params,
|
80
|
+
query_params: query_params,
|
81
|
+
form_params: form_params,
|
82
|
+
body: post_body,
|
83
|
+
auth_names: auth_names,
|
84
|
+
return_type: return_type
|
85
|
+
)
|
86
|
+
|
87
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
88
|
+
if @api_client.config.debugging
|
89
|
+
@api_client.config.logger.debug "API called: TeamApi#attach_team_to_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
90
|
+
end
|
91
|
+
[data, status_code, headers]
|
92
|
+
end
|
93
|
+
|
94
|
+
# Create a new team
|
95
|
+
# @param team [Team] The team data to create
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @return [Team]
|
98
|
+
def create_team(team, opts = {})
|
99
|
+
data, _status_code, _headers = create_team_with_http_info(team, opts)
|
100
|
+
data
|
101
|
+
end
|
102
|
+
|
103
|
+
# Create a new team
|
104
|
+
# @param team [Team] The team data to create
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @return [Array<(Team, Integer, Hash)>] Team data, response status code and response headers
|
107
|
+
def create_team_with_http_info(team, opts = {})
|
108
|
+
if @api_client.config.debugging
|
109
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.create_team ...'
|
110
|
+
end
|
111
|
+
# verify the required parameter 'team' is set
|
112
|
+
if @api_client.config.client_side_validation && team.nil?
|
113
|
+
raise ArgumentError, "Missing the required parameter 'team' when calling TeamApi.create_team"
|
114
|
+
end
|
115
|
+
|
116
|
+
# resource path
|
117
|
+
local_var_path = '/teams'
|
118
|
+
|
119
|
+
# query parameters
|
120
|
+
query_params = opts[:query_params] || {}
|
121
|
+
|
122
|
+
# header parameters
|
123
|
+
header_params = opts[:header_params] || {}
|
124
|
+
# HTTP header 'Accept' (if needed)
|
125
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
126
|
+
# HTTP header 'Content-Type'
|
127
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
128
|
+
unless content_type.nil?
|
129
|
+
header_params['Content-Type'] = content_type
|
130
|
+
end
|
131
|
+
|
132
|
+
# form parameters
|
133
|
+
form_params = opts[:form_params] || {}
|
134
|
+
|
135
|
+
# http body (model)
|
136
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(team)
|
137
|
+
|
138
|
+
# return_type
|
139
|
+
return_type = opts[:debug_return_type] || 'Team'
|
140
|
+
|
141
|
+
# auth_names
|
142
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
143
|
+
|
144
|
+
new_options = opts.merge(
|
145
|
+
operation: :'TeamApi.create_team',
|
146
|
+
header_params: header_params,
|
147
|
+
query_params: query_params,
|
148
|
+
form_params: form_params,
|
149
|
+
body: post_body,
|
150
|
+
auth_names: auth_names,
|
151
|
+
return_type: return_type
|
152
|
+
)
|
153
|
+
|
154
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug "API called: TeamApi#create_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
+
end
|
158
|
+
[data, status_code, headers]
|
159
|
+
end
|
160
|
+
|
161
|
+
# Delete a specific team
|
162
|
+
# @param team_id [String] A team identifier or slug
|
163
|
+
# @param [Hash] opts the optional parameters
|
164
|
+
# @return [Notification]
|
165
|
+
def delete_team(team_id, opts = {})
|
166
|
+
data, _status_code, _headers = delete_team_with_http_info(team_id, opts)
|
167
|
+
data
|
168
|
+
end
|
169
|
+
|
170
|
+
# Delete a specific team
|
171
|
+
# @param team_id [String] A team identifier or slug
|
172
|
+
# @param [Hash] opts the optional parameters
|
173
|
+
# @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
|
174
|
+
def delete_team_with_http_info(team_id, opts = {})
|
175
|
+
if @api_client.config.debugging
|
176
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.delete_team ...'
|
177
|
+
end
|
178
|
+
# verify the required parameter 'team_id' is set
|
179
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
180
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.delete_team"
|
181
|
+
end
|
182
|
+
|
183
|
+
# resource path
|
184
|
+
local_var_path = '/teams/{team_id}'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
185
|
+
|
186
|
+
# query parameters
|
187
|
+
query_params = opts[:query_params] || {}
|
188
|
+
|
189
|
+
# header parameters
|
190
|
+
header_params = opts[:header_params] || {}
|
191
|
+
# HTTP header 'Accept' (if needed)
|
192
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
193
|
+
|
194
|
+
# form parameters
|
195
|
+
form_params = opts[:form_params] || {}
|
196
|
+
|
197
|
+
# http body (model)
|
198
|
+
post_body = opts[:debug_body]
|
199
|
+
|
200
|
+
# return_type
|
201
|
+
return_type = opts[:debug_return_type] || 'Notification'
|
202
|
+
|
203
|
+
# auth_names
|
204
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
205
|
+
|
206
|
+
new_options = opts.merge(
|
207
|
+
operation: :'TeamApi.delete_team',
|
208
|
+
header_params: header_params,
|
209
|
+
query_params: query_params,
|
210
|
+
form_params: form_params,
|
211
|
+
body: post_body,
|
212
|
+
auth_names: auth_names,
|
213
|
+
return_type: return_type
|
214
|
+
)
|
215
|
+
|
216
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
217
|
+
if @api_client.config.debugging
|
218
|
+
@api_client.config.logger.debug "API called: TeamApi#delete_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
219
|
+
end
|
220
|
+
[data, status_code, headers]
|
221
|
+
end
|
222
|
+
|
223
|
+
# Remove a user from team
|
224
|
+
# @param team_id [String] A team identifier or slug
|
225
|
+
# @param team_user_params [TeamUserParams] The team user data to delete
|
226
|
+
# @param [Hash] opts the optional parameters
|
227
|
+
# @return [Notification]
|
228
|
+
def delete_team_from_user(team_id, team_user_params, opts = {})
|
229
|
+
data, _status_code, _headers = delete_team_from_user_with_http_info(team_id, team_user_params, opts)
|
230
|
+
data
|
231
|
+
end
|
232
|
+
|
233
|
+
# Remove a user from team
|
234
|
+
# @param team_id [String] A team identifier or slug
|
235
|
+
# @param team_user_params [TeamUserParams] The team user data to delete
|
236
|
+
# @param [Hash] opts the optional parameters
|
237
|
+
# @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
|
238
|
+
def delete_team_from_user_with_http_info(team_id, team_user_params, opts = {})
|
239
|
+
if @api_client.config.debugging
|
240
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.delete_team_from_user ...'
|
241
|
+
end
|
242
|
+
# verify the required parameter 'team_id' is set
|
243
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
244
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.delete_team_from_user"
|
245
|
+
end
|
246
|
+
# verify the required parameter 'team_user_params' is set
|
247
|
+
if @api_client.config.client_side_validation && team_user_params.nil?
|
248
|
+
raise ArgumentError, "Missing the required parameter 'team_user_params' when calling TeamApi.delete_team_from_user"
|
249
|
+
end
|
250
|
+
|
251
|
+
# resource path
|
252
|
+
local_var_path = '/teams/{team_id}/users'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
253
|
+
|
254
|
+
# query parameters
|
255
|
+
query_params = opts[:query_params] || {}
|
256
|
+
|
257
|
+
# header parameters
|
258
|
+
header_params = opts[:header_params] || {}
|
259
|
+
# HTTP header 'Accept' (if needed)
|
260
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
261
|
+
# HTTP header 'Content-Type'
|
262
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
263
|
+
unless content_type.nil?
|
264
|
+
header_params['Content-Type'] = content_type
|
265
|
+
end
|
266
|
+
|
267
|
+
# form parameters
|
268
|
+
form_params = opts[:form_params] || {}
|
269
|
+
|
270
|
+
# http body (model)
|
271
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(team_user_params)
|
272
|
+
|
273
|
+
# return_type
|
274
|
+
return_type = opts[:debug_return_type] || 'Notification'
|
275
|
+
|
276
|
+
# auth_names
|
277
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
278
|
+
|
279
|
+
new_options = opts.merge(
|
280
|
+
operation: :'TeamApi.delete_team_from_user',
|
281
|
+
header_params: header_params,
|
282
|
+
query_params: query_params,
|
283
|
+
form_params: form_params,
|
284
|
+
body: post_body,
|
285
|
+
auth_names: auth_names,
|
286
|
+
return_type: return_type
|
287
|
+
)
|
288
|
+
|
289
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
290
|
+
if @api_client.config.debugging
|
291
|
+
@api_client.config.logger.debug "API called: TeamApi#delete_team_from_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
292
|
+
end
|
293
|
+
[data, status_code, headers]
|
294
|
+
end
|
295
|
+
|
296
|
+
# Fetch all users assigned to team
|
297
|
+
# @param team_id [String] A team identifier or slug
|
298
|
+
# @param [Hash] opts the optional parameters
|
299
|
+
# @option opts [String] :search Search query
|
300
|
+
# @option opts [String] :sort Sorting column
|
301
|
+
# @option opts [String] :order Sorting order
|
302
|
+
# @option opts [Integer] :limit Paging limit
|
303
|
+
# @option opts [Integer] :offset Paging offset
|
304
|
+
# @return [TeamUsers]
|
305
|
+
def list_team_users(team_id, opts = {})
|
306
|
+
data, _status_code, _headers = list_team_users_with_http_info(team_id, opts)
|
307
|
+
data
|
308
|
+
end
|
309
|
+
|
310
|
+
# Fetch all users assigned to team
|
311
|
+
# @param team_id [String] A team identifier or slug
|
312
|
+
# @param [Hash] opts the optional parameters
|
313
|
+
# @option opts [String] :search Search query
|
314
|
+
# @option opts [String] :sort Sorting column
|
315
|
+
# @option opts [String] :order Sorting order
|
316
|
+
# @option opts [Integer] :limit Paging limit
|
317
|
+
# @option opts [Integer] :offset Paging offset
|
318
|
+
# @return [Array<(TeamUsers, Integer, Hash)>] TeamUsers data, response status code and response headers
|
319
|
+
def list_team_users_with_http_info(team_id, opts = {})
|
320
|
+
if @api_client.config.debugging
|
321
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.list_team_users ...'
|
322
|
+
end
|
323
|
+
# verify the required parameter 'team_id' is set
|
324
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
325
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.list_team_users"
|
326
|
+
end
|
327
|
+
|
328
|
+
allowable_values = %w[username email fullname admin active]
|
329
|
+
if @api_client.config.client_side_validation && opts[:sort] && !allowable_values.include?(opts[:sort])
|
330
|
+
raise ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
331
|
+
end
|
332
|
+
|
333
|
+
allowable_values = %w[asc desc]
|
334
|
+
if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
|
335
|
+
raise ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
|
336
|
+
end
|
337
|
+
|
338
|
+
# resource path
|
339
|
+
local_var_path = '/teams/{team_id}/users'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
340
|
+
|
341
|
+
# query parameters
|
342
|
+
query_params = opts[:query_params] || {}
|
343
|
+
query_params[:search] = opts[:search] unless opts[:search].nil?
|
344
|
+
query_params[:sort] = opts[:sort] unless opts[:sort].nil?
|
345
|
+
query_params[:order] = opts[:order] unless opts[:order].nil?
|
346
|
+
query_params[:limit] = opts[:limit] unless opts[:limit].nil?
|
347
|
+
query_params[:offset] = opts[:offset] unless opts[:offset].nil?
|
348
|
+
|
349
|
+
# header parameters
|
350
|
+
header_params = opts[:header_params] || {}
|
351
|
+
# HTTP header 'Accept' (if needed)
|
352
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
353
|
+
|
354
|
+
# form parameters
|
355
|
+
form_params = opts[:form_params] || {}
|
356
|
+
|
357
|
+
# http body (model)
|
358
|
+
post_body = opts[:debug_body]
|
359
|
+
|
360
|
+
# return_type
|
361
|
+
return_type = opts[:debug_return_type] || 'TeamUsers'
|
362
|
+
|
363
|
+
# auth_names
|
364
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
365
|
+
|
366
|
+
new_options = opts.merge(
|
367
|
+
operation: :'TeamApi.list_team_users',
|
368
|
+
header_params: header_params,
|
369
|
+
query_params: query_params,
|
370
|
+
form_params: form_params,
|
371
|
+
body: post_body,
|
372
|
+
auth_names: auth_names,
|
373
|
+
return_type: return_type
|
374
|
+
)
|
375
|
+
|
376
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
377
|
+
if @api_client.config.debugging
|
378
|
+
@api_client.config.logger.debug "API called: TeamApi#list_team_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
379
|
+
end
|
380
|
+
[data, status_code, headers]
|
381
|
+
end
|
382
|
+
|
383
|
+
# Fetch all available teams
|
384
|
+
# @param [Hash] opts the optional parameters
|
385
|
+
# @option opts [String] :search Search query
|
386
|
+
# @option opts [String] :sort Sorting column
|
387
|
+
# @option opts [String] :order Sorting order
|
388
|
+
# @option opts [Integer] :limit Paging limit
|
389
|
+
# @option opts [Integer] :offset Paging offset
|
390
|
+
# @return [Teams]
|
391
|
+
def list_teams(opts = {})
|
392
|
+
data, _status_code, _headers = list_teams_with_http_info(opts)
|
393
|
+
data
|
394
|
+
end
|
395
|
+
|
396
|
+
# Fetch all available teams
|
397
|
+
# @param [Hash] opts the optional parameters
|
398
|
+
# @option opts [String] :search Search query
|
399
|
+
# @option opts [String] :sort Sorting column
|
400
|
+
# @option opts [String] :order Sorting order
|
401
|
+
# @option opts [Integer] :limit Paging limit
|
402
|
+
# @option opts [Integer] :offset Paging offset
|
403
|
+
# @return [Array<(Teams, Integer, Hash)>] Teams data, response status code and response headers
|
404
|
+
def list_teams_with_http_info(opts = {})
|
405
|
+
if @api_client.config.debugging
|
406
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.list_teams ...'
|
407
|
+
end
|
408
|
+
allowable_values = %w[slug name]
|
409
|
+
if @api_client.config.client_side_validation && opts[:sort] && !allowable_values.include?(opts[:sort])
|
410
|
+
raise ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
411
|
+
end
|
412
|
+
|
413
|
+
allowable_values = %w[asc desc]
|
414
|
+
if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
|
415
|
+
raise ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
|
416
|
+
end
|
417
|
+
|
418
|
+
# resource path
|
419
|
+
local_var_path = '/teams'
|
420
|
+
|
421
|
+
# query parameters
|
422
|
+
query_params = opts[:query_params] || {}
|
423
|
+
query_params[:search] = opts[:search] unless opts[:search].nil?
|
424
|
+
query_params[:sort] = opts[:sort] unless opts[:sort].nil?
|
425
|
+
query_params[:order] = opts[:order] unless opts[:order].nil?
|
426
|
+
query_params[:limit] = opts[:limit] unless opts[:limit].nil?
|
427
|
+
query_params[:offset] = opts[:offset] unless opts[:offset].nil?
|
428
|
+
|
429
|
+
# header parameters
|
430
|
+
header_params = opts[:header_params] || {}
|
431
|
+
# HTTP header 'Accept' (if needed)
|
432
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
433
|
+
|
434
|
+
# form parameters
|
435
|
+
form_params = opts[:form_params] || {}
|
436
|
+
|
437
|
+
# http body (model)
|
438
|
+
post_body = opts[:debug_body]
|
439
|
+
|
440
|
+
# return_type
|
441
|
+
return_type = opts[:debug_return_type] || 'Teams'
|
442
|
+
|
443
|
+
# auth_names
|
444
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
445
|
+
|
446
|
+
new_options = opts.merge(
|
447
|
+
operation: :'TeamApi.list_teams',
|
448
|
+
header_params: header_params,
|
449
|
+
query_params: query_params,
|
450
|
+
form_params: form_params,
|
451
|
+
body: post_body,
|
452
|
+
auth_names: auth_names,
|
453
|
+
return_type: return_type
|
454
|
+
)
|
455
|
+
|
456
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
457
|
+
if @api_client.config.debugging
|
458
|
+
@api_client.config.logger.debug "API called: TeamApi#list_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
459
|
+
end
|
460
|
+
[data, status_code, headers]
|
461
|
+
end
|
462
|
+
|
463
|
+
# Update user perms for team
|
464
|
+
# @param team_id [String] A team identifier or slug
|
465
|
+
# @param team_user_params [TeamUserParams] The team user data to update
|
466
|
+
# @param [Hash] opts the optional parameters
|
467
|
+
# @return [Notification]
|
468
|
+
def permit_team_user(team_id, team_user_params, opts = {})
|
469
|
+
data, _status_code, _headers = permit_team_user_with_http_info(team_id, team_user_params, opts)
|
470
|
+
data
|
471
|
+
end
|
472
|
+
|
473
|
+
# Update user perms for team
|
474
|
+
# @param team_id [String] A team identifier or slug
|
475
|
+
# @param team_user_params [TeamUserParams] The team user data to update
|
476
|
+
# @param [Hash] opts the optional parameters
|
477
|
+
# @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
|
478
|
+
def permit_team_user_with_http_info(team_id, team_user_params, opts = {})
|
479
|
+
if @api_client.config.debugging
|
480
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.permit_team_user ...'
|
481
|
+
end
|
482
|
+
# verify the required parameter 'team_id' is set
|
483
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
484
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.permit_team_user"
|
485
|
+
end
|
486
|
+
# verify the required parameter 'team_user_params' is set
|
487
|
+
if @api_client.config.client_side_validation && team_user_params.nil?
|
488
|
+
raise ArgumentError, "Missing the required parameter 'team_user_params' when calling TeamApi.permit_team_user"
|
489
|
+
end
|
490
|
+
|
491
|
+
# resource path
|
492
|
+
local_var_path = '/teams/{team_id}/users'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
493
|
+
|
494
|
+
# query parameters
|
495
|
+
query_params = opts[:query_params] || {}
|
496
|
+
|
497
|
+
# header parameters
|
498
|
+
header_params = opts[:header_params] || {}
|
499
|
+
# HTTP header 'Accept' (if needed)
|
500
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
501
|
+
# HTTP header 'Content-Type'
|
502
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
503
|
+
unless content_type.nil?
|
504
|
+
header_params['Content-Type'] = content_type
|
505
|
+
end
|
506
|
+
|
507
|
+
# form parameters
|
508
|
+
form_params = opts[:form_params] || {}
|
509
|
+
|
510
|
+
# http body (model)
|
511
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(team_user_params)
|
512
|
+
|
513
|
+
# return_type
|
514
|
+
return_type = opts[:debug_return_type] || 'Notification'
|
515
|
+
|
516
|
+
# auth_names
|
517
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
518
|
+
|
519
|
+
new_options = opts.merge(
|
520
|
+
operation: :'TeamApi.permit_team_user',
|
521
|
+
header_params: header_params,
|
522
|
+
query_params: query_params,
|
523
|
+
form_params: form_params,
|
524
|
+
body: post_body,
|
525
|
+
auth_names: auth_names,
|
526
|
+
return_type: return_type
|
527
|
+
)
|
528
|
+
|
529
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
530
|
+
if @api_client.config.debugging
|
531
|
+
@api_client.config.logger.debug "API called: TeamApi#permit_team_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
532
|
+
end
|
533
|
+
[data, status_code, headers]
|
534
|
+
end
|
535
|
+
|
536
|
+
# Fetch a specific team
|
537
|
+
# @param team_id [String] A team identifier or slug
|
538
|
+
# @param [Hash] opts the optional parameters
|
539
|
+
# @return [Team]
|
540
|
+
def show_team(team_id, opts = {})
|
541
|
+
data, _status_code, _headers = show_team_with_http_info(team_id, opts)
|
542
|
+
data
|
543
|
+
end
|
544
|
+
|
545
|
+
# Fetch a specific team
|
546
|
+
# @param team_id [String] A team identifier or slug
|
547
|
+
# @param [Hash] opts the optional parameters
|
548
|
+
# @return [Array<(Team, Integer, Hash)>] Team data, response status code and response headers
|
549
|
+
def show_team_with_http_info(team_id, opts = {})
|
550
|
+
if @api_client.config.debugging
|
551
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.show_team ...'
|
552
|
+
end
|
553
|
+
# verify the required parameter 'team_id' is set
|
554
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
555
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.show_team"
|
556
|
+
end
|
557
|
+
|
558
|
+
# resource path
|
559
|
+
local_var_path = '/teams/{team_id}'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
560
|
+
|
561
|
+
# query parameters
|
562
|
+
query_params = opts[:query_params] || {}
|
563
|
+
|
564
|
+
# header parameters
|
565
|
+
header_params = opts[:header_params] || {}
|
566
|
+
# HTTP header 'Accept' (if needed)
|
567
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
568
|
+
|
569
|
+
# form parameters
|
570
|
+
form_params = opts[:form_params] || {}
|
571
|
+
|
572
|
+
# http body (model)
|
573
|
+
post_body = opts[:debug_body]
|
574
|
+
|
575
|
+
# return_type
|
576
|
+
return_type = opts[:debug_return_type] || 'Team'
|
577
|
+
|
578
|
+
# auth_names
|
579
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
580
|
+
|
581
|
+
new_options = opts.merge(
|
582
|
+
operation: :'TeamApi.show_team',
|
583
|
+
header_params: header_params,
|
584
|
+
query_params: query_params,
|
585
|
+
form_params: form_params,
|
586
|
+
body: post_body,
|
587
|
+
auth_names: auth_names,
|
588
|
+
return_type: return_type
|
589
|
+
)
|
590
|
+
|
591
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
592
|
+
if @api_client.config.debugging
|
593
|
+
@api_client.config.logger.debug "API called: TeamApi#show_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
594
|
+
end
|
595
|
+
[data, status_code, headers]
|
596
|
+
end
|
597
|
+
|
598
|
+
# Update a specific team
|
599
|
+
# @param team_id [String] A team identifier or slug
|
600
|
+
# @param team [Team] The team data to update
|
601
|
+
# @param [Hash] opts the optional parameters
|
602
|
+
# @return [Team]
|
603
|
+
def update_team(team_id, team, opts = {})
|
604
|
+
data, _status_code, _headers = update_team_with_http_info(team_id, team, opts)
|
605
|
+
data
|
606
|
+
end
|
607
|
+
|
608
|
+
# Update a specific team
|
609
|
+
# @param team_id [String] A team identifier or slug
|
610
|
+
# @param team [Team] The team data to update
|
611
|
+
# @param [Hash] opts the optional parameters
|
612
|
+
# @return [Array<(Team, Integer, Hash)>] Team data, response status code and response headers
|
613
|
+
def update_team_with_http_info(team_id, team, opts = {})
|
614
|
+
if @api_client.config.debugging
|
615
|
+
@api_client.config.logger.debug 'Calling API: TeamApi.update_team ...'
|
616
|
+
end
|
617
|
+
# verify the required parameter 'team_id' is set
|
618
|
+
if @api_client.config.client_side_validation && team_id.nil?
|
619
|
+
raise ArgumentError, "Missing the required parameter 'team_id' when calling TeamApi.update_team"
|
620
|
+
end
|
621
|
+
# verify the required parameter 'team' is set
|
622
|
+
if @api_client.config.client_side_validation && team.nil?
|
623
|
+
raise ArgumentError, "Missing the required parameter 'team' when calling TeamApi.update_team"
|
624
|
+
end
|
625
|
+
|
626
|
+
# resource path
|
627
|
+
local_var_path = '/teams/{team_id}'.sub('{' + 'team_id' + '}', CGI.escape(team_id.to_s))
|
628
|
+
|
629
|
+
# query parameters
|
630
|
+
query_params = opts[:query_params] || {}
|
631
|
+
|
632
|
+
# header parameters
|
633
|
+
header_params = opts[:header_params] || {}
|
634
|
+
# HTTP header 'Accept' (if needed)
|
635
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
636
|
+
# HTTP header 'Content-Type'
|
637
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
638
|
+
unless content_type.nil?
|
639
|
+
header_params['Content-Type'] = content_type
|
640
|
+
end
|
641
|
+
|
642
|
+
# form parameters
|
643
|
+
form_params = opts[:form_params] || {}
|
644
|
+
|
645
|
+
# http body (model)
|
646
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(team)
|
647
|
+
|
648
|
+
# return_type
|
649
|
+
return_type = opts[:debug_return_type] || 'Team'
|
650
|
+
|
651
|
+
# auth_names
|
652
|
+
auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
|
653
|
+
|
654
|
+
new_options = opts.merge(
|
655
|
+
operation: :'TeamApi.update_team',
|
656
|
+
header_params: header_params,
|
657
|
+
query_params: query_params,
|
658
|
+
form_params: form_params,
|
659
|
+
body: post_body,
|
660
|
+
auth_names: auth_names,
|
661
|
+
return_type: return_type
|
662
|
+
)
|
663
|
+
|
664
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
665
|
+
if @api_client.config.debugging
|
666
|
+
@api_client.config.logger.debug "API called: TeamApi#update_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
667
|
+
end
|
668
|
+
[data, status_code, headers]
|
669
|
+
end
|
670
|
+
end
|
671
|
+
end
|