Method: OpenapiClient::TenantsApi#list_tenant_users_with_http_info

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

#list_tenant_users_with_http_info(proj_id, tenant_id, env_id, opts = {}) ⇒ Array<(PaginatedResultUserRead, Integer, Hash)>

List Tenant Users

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

  • tenant_id (String)

    Either the unique id of the tenant, or the URL-friendly key of the tenant (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;).

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

    the optional parameters

Options Hash (opts):

  • :search (String)

    Text search for the email field

  • :page (Integer)

    Page number of the results to fetch, starting at 1. (default to 1)

  • :per_page (Integer)

    The number of results per page (max 100). (default to 30)

Returns:

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

    PaginatedResultUserRead data, response status code and response headers



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
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
# File 'lib/openapi_client/api/tenants_api.rb', line 356

def list_tenant_users_with_http_info(proj_id, tenant_id, env_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TenantsApi.list_tenant_users ...'
  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 TenantsApi.list_tenant_users"
  end
  # verify the required parameter 'tenant_id' is set
  if @api_client.config.client_side_validation && tenant_id.nil?
    fail ArgumentError, "Missing the required parameter 'tenant_id' when calling TenantsApi.list_tenant_users"
  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 TenantsApi.list_tenant_users"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling TenantsApi.list_tenant_users, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling TenantsApi.list_tenant_users, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling TenantsApi.list_tenant_users, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'tenant_id' + '}', CGI.escape(tenant_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].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] || 'PaginatedResultUserRead'

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

  new_options = opts.merge(
    :operation => :"TenantsApi.list_tenant_users",
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TenantsApi#list_tenant_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end