Class: DatadogAPIClient::V2::TeamsAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TeamsAPI.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

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

Create a team.



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

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

Create a team link.



97
98
99
100
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 97

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



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 110

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.



169
170
171
172
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 169

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

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

Add a user to a team.

Add a user to a team.

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    UserTeamResponse data, response status code and response headers



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 182

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

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

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

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

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

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

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

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

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

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

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

Create a team.

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

Parameters:

Returns:

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

    TeamResponse data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 42

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.



241
242
243
244
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 241

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

Remove a team link.



306
307
308
309
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 306

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



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 319

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.



376
377
378
379
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 376

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

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

Remove a user from a team.

Remove a user from a team.

Parameters:

  • team_id (String)

    None

  • user_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 389

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

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

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

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

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

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

  # return_type
  return_type = opts[:debug_return_type]

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

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

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

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

Remove a team.

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

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



253
254
255
256
257
258
259
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 253

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.



446
447
448
449
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 446

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

Get a team link.



511
512
513
514
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 511

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



524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 524

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.



581
582
583
584
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 581

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



593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 593

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.



646
647
648
649
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 646

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

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

Get team memberships.

Get a paginated list of members for a team

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

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

  • :page_number (Integer)

    Specific page number to return.

  • :sort (GetTeamMembershipsSort)

    Specifies the order of returned team memberships

  • :filter_keyword (String)

    Search query, can be user email or name

Returns:

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

    UserTeamsResponse data, response status code and response headers



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

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:



727
728
729
730
731
732
733
734
735
736
737
738
739
740
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 727

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

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

Get permission settings for a team.



745
746
747
748
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 745

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:



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
800
801
802
803
804
805
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 757

def get_team_permission_settings_with_http_info(team_id, opts = {})

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

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

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

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

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

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

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

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

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

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

Get a team.

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

Parameters:

  • team_id (String)

    None

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

    the optional parameters

Returns:

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

    TeamResponse data, response status code and response headers



458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 458

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.



810
811
812
813
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 810

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



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
867
868
869
870
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 822

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

Get all teams.



875
876
877
878
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 875

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

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

Get all teams.

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

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page_number (Integer)

    Specific page number to return.

  • :page_size (Integer)

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

  • :sort (ListTeamsSort)

    Specifies the order of the returned teams

  • :include (Array<ListTeamsInclude>)

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

  • :filter_keyword (String)

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

  • :filter_me (Boolean)

    When true, only returns teams the current user belongs to

  • :fields_team (Array<TeamsField>)

    List of fields that need to be fetched.

Returns:

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

    TeamsResponse data, response status code and response headers



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
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 894

def list_teams_with_http_info(opts = {})

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

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

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

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

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

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

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

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

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

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

Get all teams.

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

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

Yields:

  • (Team)

    Paginated items



959
960
961
962
963
964
965
966
967
968
969
970
971
972
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 959

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

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

Update a team.



977
978
979
980
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 977

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.



1050
1051
1052
1053
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1050

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



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

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.



1127
1128
1129
1130
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1127

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

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

Update a user’s membership attributes on a team.

Update a user’s membership attributes on a team.

Parameters:

  • team_id (String)

    None

  • user_id (String)

    None

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

    the optional parameters

Returns:

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

    UserTeamResponse data, response status code and response headers



1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1141

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

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

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

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

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

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

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

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

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

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

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

Update permission setting for team.



1204
1205
1206
1207
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1204

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:



1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1218

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



991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 991

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