Class: DatadogAPIClient::V2::OrgAuthorizedClientsAPI

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of OrgAuthorizedClientsAPI.



22
23
24
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_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/org_authorized_clients_api.rb', line 20

def api_client
  @api_client
end

Instance Method Details

#delete_org_authorized_client(org_authorized_client_id, opts = {}) ⇒ Object

Delete an org authorized client.



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

def delete_org_authorized_client(org_authorized_client_id, opts = {})
  delete_org_authorized_client_with_http_info(org_authorized_client_id, opts)
  nil
end

#delete_org_authorized_client_all_user_authorizations(org_authorized_client_id, user_id, opts = {}) ⇒ Object

Delete a user's authorizations for a client.



94
95
96
97
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 94

def delete_org_authorized_client_all_user_authorizations(org_authorized_client_id, user_id, opts = {})
  delete_org_authorized_client_all_user_authorizations_with_http_info(org_authorized_client_id, user_id, opts)
  nil
end

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

Delete a user's authorizations for a client.

Disable all authorizations for a specific user for the specified OAuth2 client in the current organization.

Parameters:

  • org_authorized_client_id (String)

    The ID of the org authorized client.

  • user_id (String)

    The ID of the user.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 107

def delete_org_authorized_client_all_user_authorizations_with_http_info(org_authorized_client_id, user_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.delete_org_authorized_client_all_user_authorizations ...'
  end
  # verify the required parameter 'org_authorized_client_id' is set
  if @api_client.config.client_side_validation && org_authorized_client_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_all_user_authorizations"
  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 OrgAuthorizedClientsAPI.delete_org_authorized_client_all_user_authorizations"
  end
  # resource path
  local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}/user/{user_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_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_org_authorized_client_all_user_authorizations,
    :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: OrgAuthorizedClientsAPI#delete_org_authorized_client_all_user_authorizations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_org_authorized_client_user_authorization(org_authorized_client_id, user_authorized_client_id, opts = {}) ⇒ Object

Delete a user authorization for a client.



164
165
166
167
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 164

def delete_org_authorized_client_user_authorization(org_authorized_client_id, user_authorized_client_id, opts = {})
  delete_org_authorized_client_user_authorization_with_http_info(org_authorized_client_id, user_authorized_client_id, opts)
  nil
end

#delete_org_authorized_client_user_authorization_with_http_info(org_authorized_client_id, user_authorized_client_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a user authorization for a client.

Disable a specific user authorization for the specified OAuth2 client in the current organization.

Parameters:

  • org_authorized_client_id (String)

    The ID of the org authorized client.

  • user_authorized_client_id (String)

    The ID of the user authorized client.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



177
178
179
180
181
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
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 177

def delete_org_authorized_client_user_authorization_with_http_info(org_authorized_client_id, user_authorized_client_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.delete_org_authorized_client_user_authorization ...'
  end
  # verify the required parameter 'org_authorized_client_id' is set
  if @api_client.config.client_side_validation && org_authorized_client_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_user_authorization"
  end
  # verify the required parameter 'user_authorized_client_id' is set
  if @api_client.config.client_side_validation && user_authorized_client_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client_user_authorization"
  end
  # resource path
  local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients/{user_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_id.to_s).gsub('%2F', '/')).sub('{user_authorized_client_id}', CGI.escape(user_authorized_client_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_org_authorized_client_user_authorization,
    :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: OrgAuthorizedClientsAPI#delete_org_authorized_client_user_authorization\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Delete an org authorized client.

Disable an OAuth2 client authorization for the current organization, revoking access for all users.

Parameters:

  • org_authorized_client_id (String)

    The ID of the org authorized client.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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

def delete_org_authorized_client_with_http_info(org_authorized_client_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.delete_org_authorized_client ...'
  end
  # verify the required parameter 'org_authorized_client_id' is set
  if @api_client.config.client_side_validation && org_authorized_client_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.delete_org_authorized_client"
  end
  # resource path
  local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_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_org_authorized_client,
    :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: OrgAuthorizedClientsAPI#delete_org_authorized_client\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_org_authorized_client(org_authorized_client_id, opts = {}) ⇒ Object

Get an org authorized client.



234
235
236
237
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 234

def get_org_authorized_client(org_authorized_client_id, opts = {})
  data, _status_code, _headers = get_org_authorized_client_with_http_info(org_authorized_client_id, opts)
  data
end

#get_org_authorized_client_with_http_info(org_authorized_client_id, opts = {}) ⇒ Array<(OrgAuthorizedClientResponse, Integer, Hash)>

Get an org authorized client.

Get a single OAuth2 client authorized for the current organization.

Parameters:

  • org_authorized_client_id (String)

    The ID of the org authorized client.

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

    the optional parameters

Options Hash (opts):

  • :include (String)

    Comma-separated list of related resources to include. Options: oauth2_client, oauth2_client.app, oauth2_client.scopes, user_authorized_clients.user.

  • :filter_user_authorized_clients_disabled (String)

    Filter included user authorized clients by disabled status.

  • :filter_user_authorized_clients_user_disabled (String)

    Filter included user authorized clients by user disabled status.

Returns:

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

    OrgAuthorizedClientResponse data, response status code and response headers



249
250
251
252
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
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 249

def get_org_authorized_client_with_http_info(org_authorized_client_id, opts = {})

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?
  query_params[:'filter[user_authorized_clients][disabled]'] = opts[:'filter_user_authorized_clients_disabled'] if !opts[:'filter_user_authorized_clients_disabled'].nil?
  query_params[:'filter[user_authorized_clients][user][disabled]'] = opts[:'filter_user_authorized_clients_user_disabled'] if !opts[:'filter_user_authorized_clients_user_disabled'].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] || 'OrgAuthorizedClientResponse'

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

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

#list_org_authorized_client_user_authorizations(org_authorized_client_id, opts = {}) ⇒ Object

List user authorizations for a client.



401
402
403
404
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 401

def list_org_authorized_client_user_authorizations(org_authorized_client_id, opts = {})
  data, _status_code, _headers = list_org_authorized_client_user_authorizations_with_http_info(org_authorized_client_id, opts)
  data
end

#list_org_authorized_client_user_authorizations_with_http_info(org_authorized_client_id, opts = {}) ⇒ Array<(UserAuthorizedClientsResponse, Integer, Hash)>

List user authorizations for a client.

Get a list of user authorizations for the specified OAuth2 client in the current organization.

Parameters:

  • org_authorized_client_id (String)

    The ID of the org authorized client.

  • 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 (OrgAuthorizedClientUserAuthorizationsSort)

    Field to sort results by. Options: user.name, user.email, oauth2_client.name.

  • :filter_disabled (String)

    Filter results by the user authorization disabled status.

  • :filter_user_name (String)

    Filter results by user name.

  • :filter_user_email (String)

    Filter results by user email.

  • :filter_user_disabled (String)

    Filter results by whether the user is disabled.

Returns:



420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 420

def list_org_authorized_client_user_authorizations_with_http_info(org_authorized_client_id, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.list_org_authorized_client_user_authorizations ...'
  end
  # verify the required parameter 'org_authorized_client_id' is set
  if @api_client.config.client_side_validation && org_authorized_client_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.list_org_authorized_client_user_authorizations"
  end
  allowable_values = ['user.name', 'user.email', 'oauth2_client.name']
  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/org_authorized_clients/{org_authorized_client_id}/user_authorized_clients'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_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[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil?
  query_params[:'filter[user][name]'] = opts[:'filter_user_name'] if !opts[:'filter_user_name'].nil?
  query_params[:'filter[user][email]'] = opts[:'filter_user_email'] if !opts[:'filter_user_email'].nil?
  query_params[:'filter[user][disabled]'] = opts[:'filter_user_disabled'] if !opts[:'filter_user_disabled'].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] || 'UserAuthorizedClientsResponse'

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

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

#list_org_authorized_client_user_authorizations_with_pagination(org_authorized_client_id, opts = {}) {|UserAuthorizedClientData| ... } ⇒ Object

List user authorizations for a client.

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

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

Yields:



488
489
490
491
492
493
494
495
496
497
498
499
500
501
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 488

def list_org_authorized_client_user_authorizations_with_pagination(org_authorized_client_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_org_authorized_client_user_authorizations(org_authorized_client_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_org_authorized_clients(opts = {}) ⇒ Object

List org authorized clients.



305
306
307
308
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 305

def list_org_authorized_clients(opts = {})
  data, _status_code, _headers = list_org_authorized_clients_with_http_info(opts)
  data
end

#list_org_authorized_clients_with_http_info(opts = {}) ⇒ Array<(OrgAuthorizedClientsResponse, Integer, Hash)>

List org authorized clients.

Get a list of all OAuth2 clients authorized for the current organization.

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.

  • :sort (String)

    Field to sort results by. Options include oauth2_client.name.

  • :filter (String)

    Filter results by client name, app title, or app description.

  • :filter_oauth2_client_name (String)

    Filter results by the OAuth2 client name.

  • :filter_disabled (String)

    Filter results by the org-level disabled status.

  • :include (String)

    Comma-separated list of related resources to include. Options: oauth2_client, oauth2_client.app, user_authorized_clients.user.

Returns:



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
372
373
374
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 323

def list_org_authorized_clients_with_http_info(opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.list_org_authorized_clients ...'
  end
  # resource path
  local_var_path = '/api/v2/org_authorized_clients'

  # 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'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'filter[oauth2_client][name]'] = opts[:'filter_oauth2_client_name'] if !opts[:'filter_oauth2_client_name'].nil?
  query_params[:'filter[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil?
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].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] || 'OrgAuthorizedClientsResponse'

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

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

#list_org_authorized_clients_with_pagination(opts = {}) {|OrgAuthorizedClientData| ... } ⇒ Object

List org authorized clients.

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

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

Yields:



383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 383

def list_org_authorized_clients_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_org_authorized_clients(opts)
        @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
        if @api_client.get_attribute_from_path(response, "data").length < page_size
          break
        end
        @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1)
    end
end

#update_org_authorized_client(org_authorized_client_id, body, opts = {}) ⇒ Object

Update an org authorized client.



506
507
508
509
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 506

def update_org_authorized_client(org_authorized_client_id, body, opts = {})
  data, _status_code, _headers = update_org_authorized_client_with_http_info(org_authorized_client_id, body, opts)
  data
end

#update_org_authorized_client_with_http_info(org_authorized_client_id, body, opts = {}) ⇒ Array<(OrgAuthorizedClientResponse, Integer, Hash)>

Update an org authorized client.

Enable or disable an OAuth2 client authorization for the current organization.

Parameters:

  • org_authorized_client_id (String)

    The ID of the org authorized client.

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

    the optional parameters

Returns:

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

    OrgAuthorizedClientResponse data, response status code and response headers



519
520
521
522
523
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
# File 'lib/datadog_api_client/v2/api/org_authorized_clients_api.rb', line 519

def update_org_authorized_client_with_http_info(org_authorized_client_id, body, opts = {})

  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrgAuthorizedClientsAPI.update_org_authorized_client ...'
  end
  # verify the required parameter 'org_authorized_client_id' is set
  if @api_client.config.client_side_validation && org_authorized_client_id.nil?
    fail ArgumentError, "Missing the required parameter 'org_authorized_client_id' when calling OrgAuthorizedClientsAPI.update_org_authorized_client"
  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 OrgAuthorizedClientsAPI.update_org_authorized_client"
  end
  # resource path
  local_var_path = '/api/v2/org_authorized_clients/{org_authorized_client_id}'.sub('{org_authorized_client_id}', CGI.escape(org_authorized_client_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] || 'OrgAuthorizedClientResponse'

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

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