Class: DatadogAPIClient::V2::TeamsAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/api/teams_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = DatadogAPIClient::APIClient.default) ⇒ TeamsAPI

Returns a new instance of TeamsAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 22

def initialize(api_client = DatadogAPIClient::APIClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



20
21
22
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#add_member_team(super_team_id, body, opts = {}) ⇒ Object

Add a member team.



29
30
31
32
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 29

def add_member_team(super_team_id, body, opts = {})
  add_member_team_with_http_info(super_team_id, body, opts)
  nil
end

#add_member_team_with_http_info(super_team_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Add a member team.

Add a member team. Adds the team given by the ‘id` in the body as a member team of the super team.

Parameters:

  • super_team_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 43

def add_member_team_with_http_info(super_team_id, body, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.add_member_team".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.add_member_team")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.add_member_team"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.add_member_team ...'
  end
  # verify the required parameter 'super_team_id' is set
  if @api_client.config.client_side_validation && super_team_id.nil?
    fail ArgumentError, "Missing the required parameter 'super_team_id' when calling TeamsAPI.add_member_team"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.add_member_team"
  end
  # resource path
  local_var_path = '/api/v2/team/{super_team_id}/member_teams'.sub('{super_team_id}', CGI.escape(super_team_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])
  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :add_member_team,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#create_team(body, opts = {}) ⇒ Object

Create a team.



108
109
110
111
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 108

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

Create a team link.



176
177
178
179
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 176

def create_team_link(team_id, body, opts = {})
  data, _status_code, _headers = create_team_link_with_http_info(team_id, body, opts)
  data
end

Create a team link.

Add a new link to a team.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamLinkResponse data, response status code and response headers



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 189

def create_team_link_with_http_info(team_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.create_team_link ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.create_team_link"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.create_team_link"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/links'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'TeamLinkResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_team_link,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#create_team_membership(team_id, body, opts = {}) ⇒ Object

Add a user to a team.



248
249
250
251
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 248

def create_team_membership(team_id, body, opts = {})
  data, _status_code, _headers = create_team_membership_with_http_info(team_id, body, opts)
  data
end

#create_team_membership_with_http_info(team_id, body, opts = {}) ⇒ Array<(UserTeamResponse, Integer, Hash)>

Add a user to a team.

Add a user to a team.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    UserTeamResponse data, response status code and response headers



261
262
263
264
265
266
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
313
314
315
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 261

def create_team_membership_with_http_info(team_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.create_team_membership ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.create_team_membership"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.create_team_membership"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/memberships'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'UserTeamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_team_membership,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

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

Create a team.

Create a new team. User IDs passed through the ‘users` relationship field are added to the team.

Parameters:

Returns:

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

    TeamResponse data, response status code and response headers



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 121

def create_team_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.create_team ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.create_team"
  end
  # resource path
  local_var_path = '/api/v2/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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'TeamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :create_team,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#delete_team(team_id, opts = {}) ⇒ Object

Remove a team.



320
321
322
323
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 320

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

Remove a team link.



385
386
387
388
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 385

def delete_team_link(team_id, link_id, opts = {})
  delete_team_link_with_http_info(team_id, link_id, opts)
  nil
end

Remove a team link.

Remove a link from a team.

Parameters:

  • team_id (String)

    None

  • link_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 398

def delete_team_link_with_http_info(team_id, link_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.delete_team_link ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.delete_team_link"
  end
  # verify the required parameter 'link_id' is set
  if @api_client.config.client_side_validation && link_id.nil?
    fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.delete_team_link"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/links/{link_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{link_id}', CGI.escape(link_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_team_link,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#delete_team_membership(team_id, user_id, opts = {}) ⇒ Object

Remove a user from a team.



455
456
457
458
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 455

def delete_team_membership(team_id, user_id, opts = {})
  delete_team_membership_with_http_info(team_id, user_id, opts)
  nil
end

#delete_team_membership_with_http_info(team_id, user_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a user from a team.

Remove a user from a team.

Parameters:

  • team_id (String)

    None

  • user_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 468

def delete_team_membership_with_http_info(team_id, user_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.delete_team_membership ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.delete_team_membership"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling TeamsAPI.delete_team_membership"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/memberships/{user_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_team_membership,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

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

Remove a team.

Remove a team using the team’s ‘id`.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 332

def delete_team_with_http_info(team_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.delete_team ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.delete_team"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :delete_team,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#get_team(team_id, opts = {}) ⇒ Object

Get a team.



525
526
527
528
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 525

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

Get a team link.



590
591
592
593
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 590

def get_team_link(team_id, link_id, opts = {})
  data, _status_code, _headers = get_team_link_with_http_info(team_id, link_id, opts)
  data
end

Get a team link.

Get a single link for a team.

Parameters:

  • team_id (String)

    None

  • link_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamLinkResponse data, response status code and response headers



603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 603

def get_team_link_with_http_info(team_id, link_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_link ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.get_team_link"
  end
  # verify the required parameter 'link_id' is set
  if @api_client.config.client_side_validation && link_id.nil?
    fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.get_team_link"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/links/{link_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{link_id}', CGI.escape(link_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TeamLinkResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_team_link,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

Get links for a team.



660
661
662
663
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 660

def get_team_links(team_id, opts = {})
  data, _status_code, _headers = get_team_links_with_http_info(team_id, opts)
  data
end

Get links for a team.

Get all links for a given team.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamLinksResponse data, response status code and response headers



672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 672

def get_team_links_with_http_info(team_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_links ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.get_team_links"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/links'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TeamLinksResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_team_links,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#get_team_memberships(team_id, opts = {}) ⇒ Object

Get team memberships.



725
726
727
728
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 725

def get_team_memberships(team_id, opts = {})
  data, _status_code, _headers = get_team_memberships_with_http_info(team_id, opts)
  data
end

#get_team_memberships_with_http_info(team_id, opts = {}) ⇒ Array<(UserTeamsResponse, Integer, Hash)>

Get team memberships.

Get a paginated list of members for a team

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Size for a given page. The maximum allowed value is 100.

  • :page_number (Integer)

    Specific page number to return.

  • :sort (GetTeamMembershipsSort)

    Specifies the order of returned team memberships

  • :filter_keyword (String)

    Search query, can be user email or name

Returns:

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

    UserTeamsResponse data, response status code and response headers



741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 741

def get_team_memberships_with_http_info(team_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_memberships ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.get_team_memberships"
  end
  allowable_values = ['manager_name', '-manager_name', 'name', '-name', 'handle', '-handle', 'email', '-email']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/memberships'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'filter[keyword]'] = opts[:'filter_keyword'] if !opts[:'filter_keyword'].nil?

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserTeamsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_team_memberships,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#get_team_memberships_with_pagination(team_id, opts = {}) {|UserTeam| ... } ⇒ Object

Get team memberships.

Provide a paginated version of #get_team_memberships, returning all items.

To use it you need to use a block: get_team_memberships_with_pagination { |item| p item }

Yields:



806
807
808
809
810
811
812
813
814
815
816
817
818
819
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 806

def get_team_memberships_with_pagination(team_id, opts = {})
    api_version = "V2"
    page_size = @api_client.get_attribute_from_path(opts, "page_size", 10)
    @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size)
    @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0)
    while true do
        response = get_team_memberships(team_id, opts)
        @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
        if @api_client.get_attribute_from_path(response, "data").length < page_size
          break
        end
        @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1)
    end
end

#get_team_permission_settings(team_id, opts = {}) ⇒ Object

Get permission settings for a team.



824
825
826
827
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 824

def get_team_permission_settings(team_id, opts = {})
  data, _status_code, _headers = get_team_permission_settings_with_http_info(team_id, opts)
  data
end

#get_team_permission_settings_with_http_info(team_id, opts = {}) ⇒ Array<(TeamPermissionSettingsResponse, Integer, Hash)>

Get permission settings for a team.

Get all permission settings for a given team.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:



836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 836

def get_team_permission_settings_with_http_info(team_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_permission_settings ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.get_team_permission_settings"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/permission-settings'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TeamPermissionSettingsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_team_permission_settings,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#get_team_with_http_info(team_id, opts = {}) ⇒ Array<(TeamResponse, Integer, Hash)>

Get a team.

Get a single team using the team’s ‘id`.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamResponse data, response status code and response headers



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 537

def get_team_with_http_info(team_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.get_team"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TeamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_team,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#get_user_memberships(user_uuid, opts = {}) ⇒ Object

Get user memberships.



889
890
891
892
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 889

def get_user_memberships(user_uuid, opts = {})
  data, _status_code, _headers = get_user_memberships_with_http_info(user_uuid, opts)
  data
end

#get_user_memberships_with_http_info(user_uuid, opts = {}) ⇒ Array<(UserTeamsResponse, Integer, Hash)>

Get user memberships.

Get a list of memberships for a user

Parameters:

  • user_uuid (String)

    None

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

    the optional parameters

Returns:

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

    UserTeamsResponse data, response status code and response headers



901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 901

def get_user_memberships_with_http_info(user_uuid, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_user_memberships ...'
  end
  # verify the required parameter 'user_uuid' is set
  if @api_client.config.client_side_validation && user_uuid.nil?
    fail ArgumentError, "Missing the required parameter 'user_uuid' when calling TeamsAPI.get_user_memberships"
  end
  # resource path
  local_var_path = '/api/v2/users/{user_uuid}/memberships'.sub('{user_uuid}', CGI.escape(user_uuid.to_s).gsub('%2F', '/'))

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UserTeamsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :get_user_memberships,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#list_member_teams(super_team_id, opts = {}) ⇒ Object

Get all member teams.



954
955
956
957
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 954

def list_member_teams(super_team_id, opts = {})
  data, _status_code, _headers = list_member_teams_with_http_info(super_team_id, opts)
  data
end

#list_member_teams_with_http_info(super_team_id, opts = {}) ⇒ Array<(TeamsResponse, Integer, Hash)>

Get all member teams.

Get all member teams.

Parameters:

  • super_team_id (String)

    None

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    Size for a given page. The maximum allowed value is 100.

  • :page_number (Integer)

    Specific page number to return.

  • :fields_team (Array<TeamsField>)

    List of fields that need to be fetched.

Returns:

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

    TeamsResponse data, response status code and response headers



969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 969

def list_member_teams_with_http_info(super_team_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.list_member_teams".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_member_teams")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_member_teams"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.list_member_teams ...'
  end
  # verify the required parameter 'super_team_id' is set
  if @api_client.config.client_side_validation && super_team_id.nil?
    fail ArgumentError, "Missing the required parameter 'super_team_id' when calling TeamsAPI.list_member_teams"
  end
  # resource path
  local_var_path = '/api/v2/team/{super_team_id}/member_teams'.sub('{super_team_id}', CGI.escape(super_team_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'fields[team]'] = @api_client.build_collection_param(opts[:'fields_team'], :csv) if !opts[:'fields_team'].nil?

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TeamsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_member_teams,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#list_member_teams_with_pagination(super_team_id, opts = {}) {|Team| ... } ⇒ Object

Get all member teams.

Provide a paginated version of #list_member_teams, returning all items.

To use it you need to use a block: list_member_teams_with_pagination { |item| p item }

Yields:

  • (Team)

    Paginated items



1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1035

def list_member_teams_with_pagination(super_team_id, opts = {})
    api_version = "V2"
    page_size = @api_client.get_attribute_from_path(opts, "page_size", 10)
    @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size)
    @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0)
    while true do
        response = list_member_teams(super_team_id, opts)
        @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
        if @api_client.get_attribute_from_path(response, "data").length < page_size
          break
        end
        @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1)
    end
end

#list_teams(opts = {}) ⇒ Object

Get all teams.



1053
1054
1055
1056
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1053

def list_teams(opts = {})
  data, _status_code, _headers = list_teams_with_http_info(opts)
  data
end

#list_teams_with_http_info(opts = {}) ⇒ Array<(TeamsResponse, Integer, Hash)>

Get all teams.

Get all teams. Can be used to search for teams using the ‘filter` and `filter` query parameters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    Specific page number to return.

  • :page_size (Integer)

    Size for a given page. The maximum allowed value is 100.

  • :sort (ListTeamsSort)

    Specifies the order of the returned teams

  • :include (Array<ListTeamsInclude>)

    Included related resources optionally requested. Allowed enum values: ‘team_links, user_team_permissions`

  • :filter_keyword (String)

    Search query. Can be team name, team handle, or email of team member

  • :filter_me (Boolean)

    When true, only returns teams the current user belongs to

  • :fields_team (Array<TeamsField>)

    List of fields that need to be fetched.

Returns:

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

    TeamsResponse data, response status code and response headers



1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1072

def list_teams_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.list_teams ...'
  end
  allowable_values = ['name', '-name', 'user_count', '-user_count']
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/team'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if !opts[:'include'].nil?
  query_params[:'filter[keyword]'] = opts[:'filter_keyword'] if !opts[:'filter_keyword'].nil?
  query_params[:'filter[me]'] = opts[:'filter_me'] if !opts[:'filter_me'].nil?
  query_params[:'fields[team]'] = @api_client.build_collection_param(opts[:'fields_team'], :csv) if !opts[:'fields_team'].nil?

  # 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[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TeamsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :list_teams,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )
  new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER

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

#list_teams_with_pagination(opts = {}) {|Team| ... } ⇒ Object

Get all teams.

Provide a paginated version of #list_teams, returning all items.

To use it you need to use a block: list_teams_with_pagination { |item| p item }

Yields:

  • (Team)

    Paginated items



1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1137

def list_teams_with_pagination(opts = {})
    api_version = "V2"
    page_size = @api_client.get_attribute_from_path(opts, "page_size", 10)
    @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size)
    @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0)
    while true do
        response = list_teams(opts)
        @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
        if @api_client.get_attribute_from_path(response, "data").length < page_size
          break
        end
        @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1)
    end
end

#remove_member_team(super_team_id, member_team_id, opts = {}) ⇒ Object

Remove a member team.



1155
1156
1157
1158
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1155

def remove_member_team(super_team_id, member_team_id, opts = {})
  remove_member_team_with_http_info(super_team_id, member_team_id, opts)
  nil
end

#remove_member_team_with_http_info(super_team_id, member_team_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Remove a member team.

Remove a super team’s member team identified by ‘member_team_id`.

Parameters:

  • super_team_id (String)

    None

  • member_team_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1168

def remove_member_team_with_http_info(super_team_id, member_team_id, opts = {})
  unstable_enabled = @api_client.config.unstable_operations["v2.remove_member_team".to_sym]
  if unstable_enabled
    @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_member_team")
  else
    raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.remove_member_team"))
  end

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.remove_member_team ...'
  end
  # verify the required parameter 'super_team_id' is set
  if @api_client.config.client_side_validation && super_team_id.nil?
    fail ArgumentError, "Missing the required parameter 'super_team_id' when calling TeamsAPI.remove_member_team"
  end
  # verify the required parameter 'member_team_id' is set
  if @api_client.config.client_side_validation && member_team_id.nil?
    fail ArgumentError, "Missing the required parameter 'member_team_id' when calling TeamsAPI.remove_member_team"
  end
  # resource path
  local_var_path = '/api/v2/team/{super_team_id}/member_teams/{member_team_id}'.sub('{super_team_id}', CGI.escape(super_team_id.to_s).gsub('%2F', '/')).sub('{member_team_id}', CGI.escape(member_team_id.to_s).gsub('%2F', '/'))

  # 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(['*/*'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :remove_member_team,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#update_team(team_id, body, opts = {}) ⇒ Object

Update a team.



1231
1232
1233
1234
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1231

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

Update a team link.



1304
1305
1306
1307
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1304

def update_team_link(team_id, link_id, body, opts = {})
  data, _status_code, _headers = update_team_link_with_http_info(team_id, link_id, body, opts)
  data
end

Update a team link.

Update a team link.

Parameters:

  • team_id (String)

    None

  • link_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamLinkResponse data, response status code and response headers



1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1318

def update_team_link_with_http_info(team_id, link_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.update_team_link ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.update_team_link"
  end
  # verify the required parameter 'link_id' is set
  if @api_client.config.client_side_validation && link_id.nil?
    fail ArgumentError, "Missing the required parameter 'link_id' when calling TeamsAPI.update_team_link"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.update_team_link"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/links/{link_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{link_id}', CGI.escape(link_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'TeamLinkResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_team_link,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#update_team_membership(team_id, user_id, body, opts = {}) ⇒ Object

Update a user’s membership attributes on a team.



1381
1382
1383
1384
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1381

def update_team_membership(team_id, user_id, body, opts = {})
  data, _status_code, _headers = update_team_membership_with_http_info(team_id, user_id, body, opts)
  data
end

#update_team_membership_with_http_info(team_id, user_id, body, opts = {}) ⇒ Array<(UserTeamResponse, Integer, Hash)>

Update a user’s membership attributes on a team.

Update a user’s membership attributes on a team.

Parameters:

  • team_id (String)

    None

  • user_id (String)

    None

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

    the optional parameters

Returns:

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

    UserTeamResponse data, response status code and response headers



1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1395

def update_team_membership_with_http_info(team_id, user_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.update_team_membership ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.update_team_membership"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling TeamsAPI.update_team_membership"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.update_team_membership"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/memberships/{user_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{user_id}', CGI.escape(user_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'UserTeamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_team_membership,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#update_team_permission_setting(team_id, action, body, opts = {}) ⇒ Object

Update permission setting for team.



1458
1459
1460
1461
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1458

def update_team_permission_setting(team_id, action, body, opts = {})
  data, _status_code, _headers = update_team_permission_setting_with_http_info(team_id, action, body, opts)
  data
end

#update_team_permission_setting_with_http_info(team_id, action, body, opts = {}) ⇒ Array<(TeamPermissionSettingResponse, Integer, Hash)>

Update permission setting for team.

Update a team permission setting for a given team.

Parameters:

Returns:



1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1472

def update_team_permission_setting_with_http_info(team_id, action, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.update_team_permission_setting ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.update_team_permission_setting"
  end
  # verify the required parameter 'action' is set
  if @api_client.config.client_side_validation && action.nil?
    fail ArgumentError, "Missing the required parameter 'action' when calling TeamsAPI.update_team_permission_setting"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.update_team_permission_setting"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/permission-settings/{action}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{action}', CGI.escape(action.to_s).gsub('%2F', '/'))

  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'TeamPermissionSettingResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_team_permission_setting,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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

#update_team_with_http_info(team_id, body, opts = {}) ⇒ Array<(TeamResponse, Integer, Hash)>

Update a team.

Update a team using the team’s ‘id`. If the `team_links` relationship is present, the associated links are updated to be in the order they appear in the array, and any existing team links not present are removed.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamResponse data, response status code and response headers



1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1245

def update_team_with_http_info(team_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.update_team ...'
  end
  # verify the required parameter 'team_id' is set
  if @api_client.config.client_side_validation && team_id.nil?
    fail ArgumentError, "Missing the required parameter 'team_id' when calling TeamsAPI.update_team"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TeamsAPI.update_team"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # 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[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'TeamResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]

  new_options = opts.merge(
    :operation => :update_team,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type,
    :api_version => "V2"
  )

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