class SmplkitGeneratedClient::Config::ConfigsApi

def create_config(config_request, opts = {})

Returns:
  • (ConfigResponse) -

Parameters:
  • opts (Hash) -- the optional parameters
  • config_request (ConfigRequest) --
def create_config(config_request, opts = {})
  data, _status_code, _headers = create_config_with_http_info(config_request, opts)
  data
end

def create_config_with_http_info(config_request, opts = {})

Returns:
  • (Array<(ConfigResponse, Integer, Hash)>) - ConfigResponse data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • config_request (ConfigRequest) --
def create_config_with_http_info(config_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigsApi.create_config ...'
  end
  # verify the required parameter 'config_request' is set
  if @api_client.config.client_side_validation && config_request.nil?
    fail ArgumentError, "Missing the required parameter 'config_request' when calling ConfigsApi.create_config"
  end
  # resource path
  local_var_path = '/api/v1/configs'
  # 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/vnd.api+json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+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(config_request)
  # return_type
  return_type = opts[:debug_return_type] || 'ConfigResponse'
  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']
  new_options = opts.merge(
    :operation => :"ConfigsApi.create_config",
    :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(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigsApi#create_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

def delete_config(id, opts = {})

Returns:
  • (nil) -

Parameters:
  • opts (Hash) -- the optional parameters
  • id (String) --
def delete_config(id, opts = {})
  delete_config_with_http_info(id, opts)
  nil
end

def delete_config_with_http_info(id, opts = {})

Returns:
  • (Array<(nil, Integer, Hash)>) - nil, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • id (String) --
def delete_config_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigsApi.delete_config ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.delete_config"
  end
  # resource path
  local_var_path = '/api/v1/configs/{id}'.sub('{id}', CGI.escape(id.to_s))
  # query parameters
  query_params = opts[:query_params] || {}
  # header parameters
  header_params = opts[:header_params] || {}
  # 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 => :"ConfigsApi.delete_config",
    :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: ConfigsApi#delete_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

def get_config(id, opts = {})

Returns:
  • (ConfigResponse) -

Parameters:
  • opts (Hash) -- the optional parameters
  • id (String) --
def get_config(id, opts = {})
  data, _status_code, _headers = get_config_with_http_info(id, opts)
  data
end

def get_config_with_http_info(id, opts = {})

Returns:
  • (Array<(ConfigResponse, Integer, Hash)>) - ConfigResponse data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • id (String) --
def get_config_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigsApi.get_config ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.get_config"
  end
  # resource path
  local_var_path = '/api/v1/configs/{id}'.sub('{id}', CGI.escape(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/vnd.api+json']) unless header_params['Accept']
  # form parameters
  form_params = opts[:form_params] || {}
  # http body (model)
  post_body = opts[:debug_body]
  # return_type
  return_type = opts[:debug_return_type] || 'ConfigResponse'
  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']
  new_options = opts.merge(
    :operation => :"ConfigsApi.get_config",
    :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: ConfigsApi#get_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

def initialize(api_client = ApiClient.default)

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

def list_configs(opts = {})

Returns:
  • (ConfigListResponse) -

Options Hash: (**opts)
  • :meta_total (Boolean) -- When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
  • :page_size (Integer) -- Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
  • :page_number (Integer) -- 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
  • :sort (String) -- Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `created_at`, `-created_at`, `key`, `-key`, `name`, `-name`, `updated_at`, `-updated_at`. (default to 'key')
  • :filter_parent (String) --

Parameters:
  • opts (Hash) -- the optional parameters
def list_configs(opts = {})
  data, _status_code, _headers = list_configs_with_http_info(opts)
  data
end

def list_configs_with_http_info(opts = {})

Returns:
  • (Array<(ConfigListResponse, Integer, Hash)>) - ConfigListResponse data, response status code and response headers

Options Hash: (**opts)
  • :meta_total (Boolean) -- When `true`, the response's `meta.pagination` block includes `total` (the total number of matching items across all pages) and `total_pages`. Computing these requires an extra `COUNT` query, so omit (or pass `false`) when the totals are not needed. Defaults to `false`. (default to false)
  • :page_size (Integer) -- Number of items per page. Optional; defaults to `1000` when omitted. Must be between `1` and `1000` inclusive — requests outside that range are rejected with a 400 error. (default to 1000)
  • :page_number (Integer) -- 1-based page number to return. Optional; defaults to `1` when omitted. Must be `>= 1` — requests with a smaller value are rejected with a 400 error. (default to 1)
  • :sort (String) -- Field to sort by. Prefix with `-` for descending order. Default: `key`. Allowed values: `created_at`, `-created_at`, `key`, `-key`, `name`, `-name`, `updated_at`, `-updated_at`. (default to 'key')
  • :filter_parent (String) --

Parameters:
  • opts (Hash) -- the optional parameters
def list_configs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigsApi.list_configs ...'
  end
  allowable_values = ["created_at", "-created_at", "key", "-key", "name", "-name", "updated_at", "-updated_at"]
  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/v1/configs'
  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[parent]'] = opts[:'filter_parent'] if !opts[:'filter_parent'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  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[:'meta[total]'] = opts[:'meta_total'] if !opts[:'meta_total'].nil?
  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json']) unless header_params['Accept']
  # form parameters
  form_params = opts[:form_params] || {}
  # http body (model)
  post_body = opts[:debug_body]
  # return_type
  return_type = opts[:debug_return_type] || 'ConfigListResponse'
  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']
  new_options = opts.merge(
    :operation => :"ConfigsApi.list_configs",
    :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: ConfigsApi#list_configs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

def update_config(id, config_request, opts = {})

Returns:
  • (ConfigResponse) -

Parameters:
  • opts (Hash) -- the optional parameters
  • config_request (ConfigRequest) --
  • id (String) --
def update_config(id, config_request, opts = {})
  data, _status_code, _headers = update_config_with_http_info(id, config_request, opts)
  data
end

def update_config_with_http_info(id, config_request, opts = {})

Returns:
  • (Array<(ConfigResponse, Integer, Hash)>) - ConfigResponse data, response status code and response headers

Parameters:
  • opts (Hash) -- the optional parameters
  • config_request (ConfigRequest) --
  • id (String) --
def update_config_with_http_info(id, config_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ConfigsApi.update_config ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ConfigsApi.update_config"
  end
  # verify the required parameter 'config_request' is set
  if @api_client.config.client_side_validation && config_request.nil?
    fail ArgumentError, "Missing the required parameter 'config_request' when calling ConfigsApi.update_config"
  end
  # resource path
  local_var_path = '/api/v1/configs/{id}'.sub('{id}', CGI.escape(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/vnd.api+json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+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(config_request)
  # return_type
  return_type = opts[:debug_return_type] || 'ConfigResponse'
  # auth_names
  auth_names = opts[:debug_auth_names] || ['HTTPBearer']
  new_options = opts.merge(
    :operation => :"ConfigsApi.update_config",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigsApi#update_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end