Class: DependencyTracker::TeamApi

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency-tracker-client/api/team_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TeamApi

Returns a new instance of TeamApi.



19
20
21
# File 'lib/dependency-tracker-client/api/team_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/dependency-tracker-client/api/team_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_team(opts = {}) ⇒ Team

Creates a new team along with an associated API key

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



26
27
28
29
# File 'lib/dependency-tracker-client/api/team_api.rb', line 26

def create_team(opts = {})
  data, _status_code, _headers = create_team_with_http_info(opts)
  data
end

#create_team_with_http_info(opts = {}) ⇒ Array<(Team, Integer, Hash)>

Creates a new team along with an associated API key

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Team, Integer, Hash)>)

    Team data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/dependency-tracker-client/api/team_api.rb', line 35

def create_team_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.create_team ...'
  end
  # resource path
  local_var_path = '/v1/team'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'Team' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#create_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_api_key(apikey, opts = {}) ⇒ nil

Deletes the specified API key

Parameters:

  • apikey (String)

    The API key to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


84
85
86
87
# File 'lib/dependency-tracker-client/api/team_api.rb', line 84

def delete_api_key(apikey, opts = {})
  delete_api_key_with_http_info(apikey, opts)
  nil
end

#delete_api_key_with_http_info(apikey, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Deletes the specified API key

Parameters:

  • apikey (String)

    The API key to delete

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/dependency-tracker-client/api/team_api.rb', line 93

def delete_api_key_with_http_info(apikey, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.delete_api_key ...'
  end
  # verify the required parameter 'apikey' is set
  if @api_client.config.client_side_validation && apikey.nil?
    fail ArgumentError, "Missing the required parameter 'apikey' when calling TeamApi.delete_api_key"
  end
  # resource path
  local_var_path = '/v1/team/key/{apikey}'.sub('{' + 'apikey' + '}', CGI.escape(apikey.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#delete_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_team(opts = {}) ⇒ nil

Deletes a team

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (nil)


142
143
144
145
# File 'lib/dependency-tracker-client/api/team_api.rb', line 142

def delete_team(opts = {})
  delete_team_with_http_info(opts)
  nil
end

#delete_team_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Deletes a team

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/dependency-tracker-client/api/team_api.rb', line 151

def delete_team_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.delete_team ...'
  end
  # resource path
  local_var_path = '/v1/team'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#delete_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_api_key(uuid, opts = {}) ⇒ ApiKey

Generates an API key and returns its value

Parameters:

  • uuid (String)

    The UUID of the team to generate a key for

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



198
199
200
201
# File 'lib/dependency-tracker-client/api/team_api.rb', line 198

def generate_api_key(uuid, opts = {})
  data, _status_code, _headers = generate_api_key_with_http_info(uuid, opts)
  data
end

#generate_api_key_with_http_info(uuid, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>

Generates an API key and returns its value

Parameters:

  • uuid (String)

    The UUID of the team to generate a key for

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ApiKey, Integer, Hash)>)

    ApiKey data, response status code and response headers



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/dependency-tracker-client/api/team_api.rb', line 207

def generate_api_key_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.generate_api_key ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling TeamApi.generate_api_key"
  end
  # resource path
  local_var_path = '/v1/team/{uuid}/key'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ApiKey' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#generate_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_team(uuid, opts = {}) ⇒ Team

Returns a specific team

Parameters:

  • uuid (String)

    The UUID of the team to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



258
259
260
261
# File 'lib/dependency-tracker-client/api/team_api.rb', line 258

def get_team(uuid, opts = {})
  data, _status_code, _headers = get_team_with_http_info(uuid, opts)
  data
end

#get_team_with_http_info(uuid, opts = {}) ⇒ Array<(Team, Integer, Hash)>

Returns a specific team

Parameters:

  • uuid (String)

    The UUID of the team to retrieve

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Team, Integer, Hash)>)

    Team data, response status code and response headers



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/dependency-tracker-client/api/team_api.rb', line 267

def get_team_with_http_info(uuid, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.get_team ...'
  end
  # verify the required parameter 'uuid' is set
  if @api_client.config.client_side_validation && uuid.nil?
    fail ArgumentError, "Missing the required parameter 'uuid' when calling TeamApi.get_team"
  end
  # resource path
  local_var_path = '/v1/team/{uuid}'.sub('{' + 'uuid' + '}', CGI.escape(uuid.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Team' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#get_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_teams(opts = {}) ⇒ Array<Team>

Returns a list of all teams

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



317
318
319
320
# File 'lib/dependency-tracker-client/api/team_api.rb', line 317

def get_teams(opts = {})
  data, _status_code, _headers = get_teams_with_http_info(opts)
  data
end

#get_teams_with_http_info(opts = {}) ⇒ Array<(Array<Team>, Integer, Hash)>

Returns a list of all teams

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<Team>, Integer, Hash)>)

    Array<Team> data, response status code and response headers



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
# File 'lib/dependency-tracker-client/api/team_api.rb', line 325

def get_teams_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.get_teams ...'
  end
  # resource path
  local_var_path = '/v1/team'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'Array<Team>' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#get_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#regenerate_api_key(apikey, opts = {}) ⇒ ApiKey

Regenerates an API key by removing the specified key, generating a new one and returning its value

Parameters:

  • apikey (String)

    The API key to regenerate

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



372
373
374
375
# File 'lib/dependency-tracker-client/api/team_api.rb', line 372

def regenerate_api_key(apikey, opts = {})
  data, _status_code, _headers = regenerate_api_key_with_http_info(apikey, opts)
  data
end

#regenerate_api_key_with_http_info(apikey, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>

Regenerates an API key by removing the specified key, generating a new one and returning its value

Parameters:

  • apikey (String)

    The API key to regenerate

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ApiKey, Integer, Hash)>)

    ApiKey data, response status code and response headers



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/dependency-tracker-client/api/team_api.rb', line 381

def regenerate_api_key_with_http_info(apikey, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.regenerate_api_key ...'
  end
  # verify the required parameter 'apikey' is set
  if @api_client.config.client_side_validation && apikey.nil?
    fail ArgumentError, "Missing the required parameter 'apikey' when calling TeamApi.regenerate_api_key"
  end
  # resource path
  local_var_path = '/v1/team/key/{apikey}'.sub('{' + 'apikey' + '}', CGI.escape(apikey.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ApiKey' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#regenerate_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_team(opts = {}) ⇒ Team

Updates a team’s fields including

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



432
433
434
435
# File 'lib/dependency-tracker-client/api/team_api.rb', line 432

def update_team(opts = {})
  data, _status_code, _headers = update_team_with_http_info(opts)
  data
end

#update_team_with_http_info(opts = {}) ⇒ Array<(Team, Integer, Hash)>

Updates a team&#39;s fields including

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Team, Integer, Hash)>)

    Team data, response status code and response headers



441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/dependency-tracker-client/api/team_api.rb', line 441

def update_team_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamApi.update_team ...'
  end
  # resource path
  local_var_path = '/v1/team'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) 

  # return_type
  return_type = opts[:return_type] || 'Team' 

  # auth_names
  auth_names = opts[:auth_names] || ['X-Api-Key']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamApi#update_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end