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_client ⇒ Object

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)>

Deprecated.

This API is deprecated.

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.

Note: This API is deprecated. For creating team hierarchy links, use the team hierarchy links API: POST /api/v2/team-hierarchy-links.

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



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
104
105
106
107
108
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 47

def add_member_team_with_http_info(super_team_id, body, opts = {})
  warn "[DEPRECATION] `AddMemberTeam` is deprecated."
  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 a team hierarchy link.



113
114
115
116
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 113

def add_team_hierarchy_link(body, opts = {})
  data, _status_code, _headers = add_team_hierarchy_link_with_http_info(body, opts)
  data
end

Create a team hierarchy link.

Create a new team hierarchy link between a parent team and a sub team.

Parameters:

Returns:

  • (Array<(TeamHierarchyLinkResponse, Integer, Hash)>) —

    TeamHierarchyLinkResponse data, response status code and response headers



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
172
173
174
175
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 125

def add_team_hierarchy_link_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.add_team_hierarchy_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.add_team_hierarchy_link"
  end
  # resource path
  local_var_path = '/api/v2/team-hierarchy-links'

  # 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] || 'TeamHierarchyLinkResponse'

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

  new_options = opts.merge(
    :operation => :add_team_hierarchy_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#add_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Create a team.



180
181
182
183
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 180

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

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

Create team connections.



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

def create_team_connections(body, opts = {})
  data, _status_code, _headers = create_team_connections_with_http_info(body, opts)
  data
end

#create_team_connections_with_http_info(body, opts = {}) ⇒ Array<(TeamConnectionsResponse, Integer, Hash)>

Create team connections.

Create multiple team connections.

Parameters:

Returns:

  • (Array<(TeamConnectionsResponse, Integer, Hash)>) —

    TeamConnectionsResponse data, response status code and response headers



260
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 260

def create_team_connections_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.create_team_connections ...'
  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_connections"
  end
  # resource path
  local_var_path = '/api/v2/team/connections'

  # 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] || 'TeamConnectionsResponse'

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

  new_options = opts.merge(
    :operation => :create_team_connections,
    :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_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Create a team link.



315
316
317
318
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 315

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



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

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.



387
388
389
390
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 387

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.

Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see Team Membership documentation.

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



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
451
452
453
454
455
456
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 402

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_notification_rule(team_id, body, opts = {}) ⇒ Object

Create team notification rule.



461
462
463
464
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 461

def create_team_notification_rule(team_id, body, opts = {})
  data, _status_code, _headers = create_team_notification_rule_with_http_info(team_id, body, opts)
  data
end

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

Create team notification rule.

Parameters:

Returns:



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
521
522
523
524
525
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 471

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.create_team_notification_rule ...'
  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_notification_rule"
  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_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/notification-rules'.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] || 'TeamNotificationRuleResponse'

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

  new_options = opts.merge(
    :operation => :create_team_notification_rule,
    :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_notification_rule\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



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 193

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.



530
531
532
533
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 530

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

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

Delete team connections.



595
596
597
598
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 595

def delete_team_connections(body, opts = {})
  delete_team_connections_with_http_info(body, opts)
  nil
end

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

Delete team connections.

Delete multiple team connections.

Parameters:

Returns:

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

    nil, response status code and response headers



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
656
657
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 607

def delete_team_connections_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.delete_team_connections ...'
  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.delete_team_connections"
  end
  # resource path
  local_var_path = '/api/v2/team/connections'

  # 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 => :delete_team_connections,
    :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_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Remove a team link.



662
663
664
665
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 662

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



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
721
722
723
724
725
726
727
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 675

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.



732
733
734
735
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 732

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.

Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see Team Membership documentation.

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



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
798
799
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 747

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_notification_rule(team_id, rule_id, opts = {}) ⇒ Object

Delete team notification rule.



804
805
806
807
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 804

def delete_team_notification_rule(team_id, rule_id, opts = {})
  delete_team_notification_rule_with_http_info(team_id, rule_id, opts)
  nil
end

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

Delete team notification rule.

Parameters:

  • team_id (String) —

    None

  • rule_id (String) —

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 814

def delete_team_notification_rule_with_http_info(team_id, rule_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.delete_team_notification_rule ...'
  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_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling TeamsAPI.delete_team_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/notification-rules/{rule_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_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_notification_rule,
    :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_notification_rule\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



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
586
587
588
589
590
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 542

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.



871
872
873
874
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 871

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

Get a team hierarchy link.



936
937
938
939
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 936

def get_team_hierarchy_link(link_id, opts = {})
  data, _status_code, _headers = get_team_hierarchy_link_with_http_info(link_id, opts)
  data
end

Get a team hierarchy link.

Get a single team hierarchy link for the given link_id.

Parameters:

  • link_id (String) —

    The team hierarchy link's identifier

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

    the optional parameters

Returns:

  • (Array<(TeamHierarchyLinkResponse, Integer, Hash)>) —

    TeamHierarchyLinkResponse data, response status code and response headers



948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 948

def get_team_hierarchy_link_with_http_info(link_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_hierarchy_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_hierarchy_link"
  end
  # resource path
  local_var_path = '/api/v2/team-hierarchy-links/{link_id}'.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] || 'TeamHierarchyLinkResponse'

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

  new_options = opts.merge(
    :operation => :get_team_hierarchy_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_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Get a team link.



1001
1002
1003
1004
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1001

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



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1014

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.



1071
1072
1073
1074
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1071

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



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
1129
1130
1131
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1083

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.



1136
1137
1138
1139
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1136

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) —

    Number of items to return per 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



1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1152

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:



1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1217

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_notification_rule(team_id, rule_id, opts = {}) ⇒ Object

Get team notification rule.



1235
1236
1237
1238
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1235

def get_team_notification_rule(team_id, rule_id, opts = {})
  data, _status_code, _headers = get_team_notification_rule_with_http_info(team_id, rule_id, opts)
  data
end

#get_team_notification_rule_with_http_info(team_id, rule_id, opts = {}) ⇒ Array<(TeamNotificationRuleResponse, Integer, Hash)>

Get team notification rule.

Parameters:

  • team_id (String) —

    None

  • rule_id (String) —

    None

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

    the optional parameters

Returns:



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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1245

def get_team_notification_rule_with_http_info(team_id, rule_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_notification_rule ...'
  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_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling TeamsAPI.get_team_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/notification-rules/{rule_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_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] || 'TeamNotificationRuleResponse'

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

  new_options = opts.merge(
    :operation => :get_team_notification_rule,
    :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_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Get team notification rules.



1302
1303
1304
1305
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1302

def get_team_notification_rules(team_id, opts = {})
  data, _status_code, _headers = get_team_notification_rules_with_http_info(team_id, opts)
  data
end

#get_team_notification_rules_with_http_info(team_id, opts = {}) ⇒ Array<(TeamNotificationRulesResponse, Integer, Hash)>

Get team notification rules.

Parameters:

  • team_id (String) —

    None

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

    the optional parameters

Returns:



1311
1312
1313
1314
1315
1316
1317
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1311

def get_team_notification_rules_with_http_info(team_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_notification_rules ...'
  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_notification_rules"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/notification-rules'.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] || 'TeamNotificationRulesResponse'

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

  new_options = opts.merge(
    :operation => :get_team_notification_rules,
    :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_notification_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Get permission settings for a team.



1364
1365
1366
1367
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1364

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:



1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1376

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_sync(filter_source, opts = {}) ⇒ Object

Get team sync configurations.



1429
1430
1431
1432
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1429

def get_team_sync(filter_source, opts = {})
  data, _status_code, _headers = get_team_sync_with_http_info(filter_source, opts)
  data
end

#get_team_sync_with_http_info(filter_source, opts = {}) ⇒ Array<(TeamSyncResponse, Integer, Hash)>

Get team sync configurations.

Get all team synchronization configurations. Returns a list of configurations used for linking or provisioning teams with external sources like GitHub or ServiceNow.

Parameters:

  • filter_source (TeamSyncAttributesSource) —

    Filter by the external source platform for team synchronization

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

    the optional parameters

Returns:

  • (Array<(TeamSyncResponse, Integer, Hash)>) —

    TeamSyncResponse data, response status code and response headers



1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1442

def get_team_sync_with_http_info(filter_source, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.get_team_sync ...'
  end
  # verify the required parameter 'filter_source' is set
  if @api_client.config.client_side_validation && filter_source.nil?
    fail ArgumentError, "Missing the required parameter 'filter_source' when calling TeamsAPI.get_team_sync"
  end
  # verify enum value
  allowable_values = ['github', 'servicenow']
  if @api_client.config.client_side_validation && !allowable_values.include?(filter_source)
    fail ArgumentError, "invalid value for \"filter_source\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v2/team/sync'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[source]'] = filter_source

  # 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] || 'TeamSyncResponse'

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

  new_options = opts.merge(
    :operation => :get_team_sync,
    :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_sync\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



883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 883

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.



1501
1502
1503
1504
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1501

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



1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1513

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.



1566
1567
1568
1569
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1566

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)>

Deprecated.

This API is deprecated.

Get all member teams.

Get all member teams.

Note: This API is deprecated. For team hierarchy relationships (parent-child teams), use the team hierarchy links API: GET /api/v2/team-hierarchy-links.

Parameters:

  • super_team_id (String) —

    None

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer) —

    Number of items to return per 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



1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1586

def list_member_teams_with_http_info(super_team_id, opts = {})
  warn "[DEPRECATION] `ListMemberTeams` is deprecated."
  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



1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1653

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_team_connections(opts = {}) ⇒ Object

List team connections.



1671
1672
1673
1674
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1671

def list_team_connections(opts = {})
  data, _status_code, _headers = list_team_connections_with_http_info(opts)
  data
end

#list_team_connections_with_http_info(opts = {}) ⇒ Array<(TeamConnectionsResponse, Integer, Hash)>

List team connections.

Returns all team connections.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer) —

    Number of items to return per page. The maximum allowed value is 100.

  • :page_number (Integer) —

    Specific page number to return.

  • :filter_sources (Array<String>) —

    Filter team connections by external source systems, such as github or servicenow.

  • :filter_team_ids (Array<String>) —

    Filter team connections by Datadog team IDs.

  • :filter_connected_team_ids (Array<String>) —

    Filter team connections by connected team IDs from external systems.

  • :filter_connection_ids (Array<String>) —

    Filter team connections by connection IDs.

Returns:

  • (Array<(TeamConnectionsResponse, Integer, Hash)>) —

    TeamConnectionsResponse data, response status code and response headers



1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1688

def list_team_connections_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.list_team_connections ...'
  end
  # resource path
  local_var_path = '/api/v2/team/connections'

  # 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[:'filter[sources]'] = @api_client.build_collection_param(opts[:'filter_sources'], :csv) if !opts[:'filter_sources'].nil?
  query_params[:'filter[team_ids]'] = @api_client.build_collection_param(opts[:'filter_team_ids'], :csv) if !opts[:'filter_team_ids'].nil?
  query_params[:'filter[connected_team_ids]'] = @api_client.build_collection_param(opts[:'filter_connected_team_ids'], :csv) if !opts[:'filter_connected_team_ids'].nil?
  query_params[:'filter[connection_ids]'] = @api_client.build_collection_param(opts[:'filter_connection_ids'], :csv) if !opts[:'filter_connection_ids'].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] || 'TeamConnectionsResponse'

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

  new_options = opts.merge(
    :operation => :list_team_connections,
    :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_team_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_team_connections_with_pagination(opts = {}) {|TeamConnection| ... } ⇒ Object

List team connections.

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

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

Yields:



1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1747

def list_team_connections_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_team_connections(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 hierarchy links.



1765
1766
1767
1768
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1765

def list_team_hierarchy_links(opts = {})
  data, _status_code, _headers = list_team_hierarchy_links_with_http_info(opts)
  data
end

Get team hierarchy links.

List all team hierarchy links that match the provided filters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer) —

    Specific page number to return.

  • :page_size (Integer) —

    Number of items to return per page. The maximum allowed value is 100.

  • :filter_parent_team (String) —

    Filter by parent team ID

  • :filter_sub_team (String) —

    Filter by sub team ID

Returns:

  • (Array<(TeamHierarchyLinksResponse, Integer, Hash)>) —

    TeamHierarchyLinksResponse data, response status code and response headers



1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1780

def list_team_hierarchy_links_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.list_team_hierarchy_links ...'
  end
  # resource path
  local_var_path = '/api/v2/team-hierarchy-links'

  # 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[:'filter[parent_team]'] = opts[:'filter_parent_team'] if !opts[:'filter_parent_team'].nil?
  query_params[:'filter[sub_team]'] = opts[:'filter_sub_team'] if !opts[:'filter_sub_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] || 'TeamHierarchyLinksResponse'

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

  new_options = opts.merge(
    :operation => :list_team_hierarchy_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#list_team_hierarchy_links\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Get team hierarchy links.

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

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

Yields:



1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1837

def list_team_hierarchy_links_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_team_hierarchy_links(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_team_hierarchy_members(team_id, opts = {}) ⇒ Object

Get team hierarchy members.



1855
1856
1857
1858
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1855

def list_team_hierarchy_members(team_id, opts = {})
  data, _status_code, _headers = list_team_hierarchy_members_with_http_info(team_id, opts)
  data
end

#list_team_hierarchy_members_with_http_info(team_id, opts = {}) ⇒ Array<(TeamHierarchyMembersResponse, Integer, Hash)>

Get team hierarchy members.

List the direct and inherited members of a team, deduplicated by user. Members of descendant teams are included unless filter[is_direct_only] is true. Datadog support users are always excluded.

Use page[number] and page[size] to paginate through the results. Invalid query parameters return a JSON:API error with status 400. Invalid or unknown team UUIDs return status 404.

Parameters:

  • team_id (String) —

    UUID of the requested root team.

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

    the optional parameters

Options Hash (opts):

  • :filter_is_direct_only (Boolean) —

    Return only direct members. By default, members inherited from descendant teams are also returned.

  • :filter_include_service_accounts (Boolean) —

    Include service accounts. Datadog support users are always excluded.

  • :filter_keyword (String) —

    Filter by a case-insensitive substring of the user name, handle, or email.

  • :include (String) —

    Comma-separated resources to include: user and team. The included team is the requested team. Whitespace is trimmed, and duplicate or empty entries are ignored.

  • :sort (String) —

    Comma-separated sort fields: name, handle, is_direct, and provisioned_by. Fields are applied in order, each optionally prefixed with - for descending order. By default, team admins come first, followed by other direct members, then inherited members, sorted by name within each group.

  • :page_number (Integer) —

    Zero-based page number. Negative values become 0. Defaults to 0.

  • :page_size (Integer) —

    Requested number of members per page. Defaults to and maxes out at 100.

Returns:



1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1880

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

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.list_team_hierarchy_members ...'
  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.list_team_hierarchy_members"
  end
  pattern = Regexp.new("^\s*((user|team)\s*)?(,\s*((user|team)\s*)?)*$")
  if @api_client.config.client_side_validation && !opts[:'include'].nil? && opts[:'include'] !~ pattern
    fail ArgumentError, "invalid value for 'opts[:\"include\"]' when calling TeamsAPI.list_team_hierarchy_members, must conform to the pattern #{pattern}."
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/members'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/'))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[is_direct_only]'] = opts[:'filter_is_direct_only'] if !opts[:'filter_is_direct_only'].nil?
  query_params[:'filter[include_service_accounts]'] = opts[:'filter_include_service_accounts'] if !opts[:'filter_include_service_accounts'].nil?
  query_params[:'filter[keyword]'] = opts[:'filter_keyword'] if !opts[:'filter_keyword'].nil?
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].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] || 'TeamHierarchyMembersResponse'

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

  new_options = opts.merge(
    :operation => :list_team_hierarchy_members,
    :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_team_hierarchy_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_team_hierarchy_members_with_pagination(team_id, opts = {}) {|TeamHierarchyMember| ... } ⇒ Object

Get team hierarchy members.

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

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

Yields:



1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1954

def list_team_hierarchy_members_with_pagination(team_id, opts = {})
    api_version = "V2"
    page_size = @api_client.get_attribute_from_path(opts, "page_size", 100)
    @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_team_hierarchy_members(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.



1972
1973
1974
1975
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1972

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[keyword] and filter[me] query parameters.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer) —

    Specific page number to return.

  • :page_size (Integer) —

    Number of items to return per 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



1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1991

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', 'link_count', '-link_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



2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2056

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.



2074
2075
2076
2077
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2074

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)>

Deprecated.

This API is deprecated.

Remove a member team.

Remove a super team's member team identified by member_team_id.

Note: This API is deprecated. For deleting team hierarchy links, use the team hierarchy links API: DELETE /api/v2/team-hierarchy-links/{link_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



2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2091

def remove_member_team_with_http_info(super_team_id, member_team_id, opts = {})
  warn "[DEPRECATION] `RemoveMemberTeam` is deprecated."
  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

Remove a team hierarchy link.



2155
2156
2157
2158
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2155

def remove_team_hierarchy_link(link_id, opts = {})
  remove_team_hierarchy_link_with_http_info(link_id, opts)
  nil
end

Remove a team hierarchy link.

Remove a team hierarchy link by the given link_id.

Parameters:

  • link_id (String) —

    The team hierarchy link's identifier

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2167

def remove_team_hierarchy_link_with_http_info(link_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.remove_team_hierarchy_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.remove_team_hierarchy_link"
  end
  # resource path
  local_var_path = '/api/v2/team-hierarchy-links/{link_id}'.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 => :remove_team_hierarchy_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#remove_team_hierarchy_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Link teams with external teams.



2220
2221
2222
2223
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2220

def sync_teams(body, opts = {})
  sync_teams_with_http_info(body, opts)
  nil
end

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

Link teams with external teams.

This endpoint configures synchronization between your existing Datadog teams and teams from GitHub or ServiceNow by matching team names. It evaluates all current Datadog teams and compares them against teams in the external source connected to your Datadog account.

This operation is read-only on the external source side, no teams will be modified or created there. This only creates new teams in Datadog when type is set to provision.

Optionally, provide selection_state to limit synchronization to specific teams or organizations and their subtrees, instead of syncing all teams.

GitHub: A GitHub organization must be connected to your Datadog account, and the GitHub App integrated with Datadog must have the Members Read permission. Matching is performed by comparing the Datadog team handle to the GitHub team slug (lowercased and kebab-cased) using a normalized exact match; case is ignored and spaces are removed.

ServiceNow: The ServiceNow integration must be configured for your Datadog account. Active assignment groups from every configured ServiceNow instance are synchronized, and the ServiceNow group hierarchy is preserved. When sync_membership is enabled, group members are matched to Datadog users by email address.

Parameters:

  • body (TeamSyncRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:

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

    nil, response status code and response headers



2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2251

def sync_teams_with_http_info(body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.sync_teams ...'
  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.sync_teams"
  end
  # resource path
  local_var_path = '/api/v2/team/sync'

  # 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 => :sync_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::Post, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TeamsAPI#sync_teams\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.



2306
2307
2308
2309
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2306

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.



2379
2380
2381
2382
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2379

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



2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2393

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.



2456
2457
2458
2459
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2456

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.

Note: Each team has a setting that determines who is allowed to modify membership of the team. The user_access_manage permission generally grants access to modify membership of any team. To get the full picture, see Team Membership documentation.

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



2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2472

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_notification_rule(team_id, rule_id, body, opts = {}) ⇒ Object

Update team notification rule.



2535
2536
2537
2538
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2535

def update_team_notification_rule(team_id, rule_id, body, opts = {})
  data, _status_code, _headers = update_team_notification_rule_with_http_info(team_id, rule_id, body, opts)
  data
end

#update_team_notification_rule_with_http_info(team_id, rule_id, body, opts = {}) ⇒ Array<(TeamNotificationRuleResponse, Integer, Hash)>

Update team notification rule.

Parameters:

  • team_id (String) —

    None

  • rule_id (String) —

    None

  • body (TeamNotificationRuleRequest)
  • opts (Hash) (defaults to: {}) —

    the optional parameters

Returns:



2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2546

def update_team_notification_rule_with_http_info(team_id, rule_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TeamsAPI.update_team_notification_rule ...'
  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_notification_rule"
  end
  # verify the required parameter 'rule_id' is set
  if @api_client.config.client_side_validation && rule_id.nil?
    fail ArgumentError, "Missing the required parameter 'rule_id' when calling TeamsAPI.update_team_notification_rule"
  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_notification_rule"
  end
  # resource path
  local_var_path = '/api/v2/team/{team_id}/notification-rules/{rule_id}'.sub('{team_id}', CGI.escape(team_id.to_s).gsub('%2F', '/')).sub('{rule_id}', CGI.escape(rule_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] || 'TeamNotificationRuleResponse'

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

  new_options = opts.merge(
    :operation => :update_team_notification_rule,
    :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_notification_rule\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.



2609
2610
2611
2612
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2609

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:



2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2623

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



2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 2320

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