Class: DatadogAPIClient::V2::TeamsAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TeamsAPI.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

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

Add a member team.



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

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

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

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.



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_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
311
312
313
314
315
316
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 260

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

  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.



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

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

Delete team connections.



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

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



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
591
592
593
594
595
596
597
598
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 542

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

  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.



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 hierarchy link.



808
809
810
811
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 808

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



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

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.



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

Get team sync configurations.



1172
1173
1174
1175
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1172

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.

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



1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1185

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

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



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

Get all member teams.



1315
1316
1317
1318
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1315

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)

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

  • :page_number (Integer)

    Specific page number to return.

  • :fields_team (Array<TeamsField>)

    List of fields that need to be fetched.

Returns:

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

    TeamsResponse data, response status code and response headers



1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1335

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



1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1402

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.



1420
1421
1422
1423
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1420

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)

    Size for a given 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.

  • :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



1437
1438
1439
1440
1441
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
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1437

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

  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:



1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1502

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.



1520
1521
1522
1523
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1520

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)

    Size for a given 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



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
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1535

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:



1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1592

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

    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

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

Remove a member team.



1712
1713
1714
1715
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1712

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



1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1729

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.



1793
1794
1795
1796
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1793

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



1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1805

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 GitHub Teams.



1858
1859
1860
1861
# File 'lib/datadog_api_client/v2/api/teams_api.rb', line 1858

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 GitHub Teams.

This endpoint attempts to link your existing Datadog teams with GitHub teams by matching their names. It evaluates all current Datadog teams and compares them against teams in the GitHub organization connected to your Datadog account, based on Datadog Team handle and GitHub Team slug (lowercased and kebab-cased).

This operation is read-only on the GitHub side, no teams will be modified or created.

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 using a normalized exact match; case is ignored and spaces are removed. No modifications are made to teams in GitHub. This only creates new teams in Datadog when type is set to provision.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

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

  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.



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