Method: OpenapiClient::ResourceRolesApi#delete_resource_role_with_http_info

Defined in:
lib/openapi_client/api/resource_roles_api.rb

#delete_resource_role_with_http_info(proj_id, env_id, resource_id, role_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete Resource Role Deletes the role and all its related data. This includes any permissions granted to said role.

Parameters:

  • proj_id (String)

    Either the unique id of the project, or the URL-friendly key of the project (i.e: the &quot;slug&quot;).

  • env_id (String)

    Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the &quot;slug&quot;).

  • resource_id (String)

    Either the unique id of the resource, or the URL-friendly key of the resource (i.e: the &quot;slug&quot;).

  • role_id (String)

    Either the unique id of the role, or the URL-friendly key of the role (i.e: the &quot;slug&quot;).

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



308
309
310
311
312
313
314
315
316
317
318
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
# File 'lib/openapi_client/api/resource_roles_api.rb', line 308

def delete_resource_role_with_http_info(proj_id, env_id, resource_id, role_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResourceRolesApi.delete_resource_role ...'
  end
  # verify the required parameter 'proj_id' is set
  if @api_client.config.client_side_validation && proj_id.nil?
    fail ArgumentError, "Missing the required parameter 'proj_id' when calling ResourceRolesApi.delete_resource_role"
  end
  # verify the required parameter 'env_id' is set
  if @api_client.config.client_side_validation && env_id.nil?
    fail ArgumentError, "Missing the required parameter 'env_id' when calling ResourceRolesApi.delete_resource_role"
  end
  # verify the required parameter 'resource_id' is set
  if @api_client.config.client_side_validation && resource_id.nil?
    fail ArgumentError, "Missing the required parameter 'resource_id' when calling ResourceRolesApi.delete_resource_role"
  end
  # verify the required parameter 'role_id' is set
  if @api_client.config.client_side_validation && role_id.nil?
    fail ArgumentError, "Missing the required parameter 'role_id' when calling ResourceRolesApi.delete_resource_role"
  end
  # resource path
  local_var_path = '/v2/schema/{proj_id}/{env_id}/resources/{resource_id}/roles/{role_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'resource_id' + '}', CGI.escape(resource_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']

  new_options = opts.merge(
    :operation => :"ResourceRolesApi.delete_resource_role",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

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