Method: OpenapiClient::TenantsApi#update_tenant_with_http_info

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

#update_tenant_with_http_info(proj_id, env_id, tenant_id, tenant_update, opts = {}) ⇒ Array<(TenantRead, Integer, Hash)>

Update Tenant Partially updates the tenant definition. Fields that will be provided will be completely overwritten.

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

  • tenant_id (String)

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

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

    the optional parameters

Returns:

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

    TenantRead data, response status code and response headers



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
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
# File 'lib/openapi_client/api/tenants_api.rb', line 538

def update_tenant_with_http_info(proj_id, env_id, tenant_id, tenant_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TenantsApi.update_tenant ...'
  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.update_tenant"
  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.update_tenant"
  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.update_tenant"
  end
  # verify the required parameter 'tenant_update' is set
  if @api_client.config.client_side_validation && tenant_update.nil?
    fail ArgumentError, "Missing the required parameter 'tenant_update' when calling TenantsApi.update_tenant"
  end
  # resource path
  local_var_path = '/v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}'.sub('{' + 'proj_id' + '}', CGI.escape(proj_id.to_s)).sub('{' + 'env_id' + '}', CGI.escape(env_id.to_s)).sub('{' + 'tenant_id' + '}', CGI.escape(tenant_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'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

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

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

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

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