class Bfwd::ConfigurationsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/bf_ruby2/api/configurations_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_api_configuration(configuration, opts = {}) click to toggle source

Create a configuration. {"nickname":"Create a new configuration","request":"createConfigurationRequest.html","response":"createConfigurationResponse.html"} @param configuration The configuration object to be created. @param [Hash] opts the optional parameters @return [APIConfigurationPagedMetadata]

# File lib/bf_ruby2/api/configurations_api.rb, line 28
def create_api_configuration(configuration, opts = {})
  data, _status_code, _headers = create_api_configuration_with_http_info(configuration, opts)
  return data
end
create_api_configuration_with_http_info(configuration, opts = {}) click to toggle source

Create a configuration. {&quot;nickname&quot;:&quot;Create a new configuration&quot;,&quot;request&quot;:&quot;createConfigurationRequest.html&quot;,&quot;response&quot;:&quot;createConfigurationResponse.html&quot;} @param configuration The configuration object to be created. @param [Hash] opts the optional parameters @return [Array<(APIConfigurationPagedMetadata, Fixnum, Hash)>] APIConfigurationPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/configurations_api.rb, line 38
def create_api_configuration_with_http_info(configuration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ConfigurationsApi.create_api_configuration ..."
  end
  # verify the required parameter 'configuration' is set
  if @api_client.config.client_side_validation && configuration.nil?
    fail ArgumentError, "Missing the required parameter 'configuration' when calling ConfigurationsApi.create_api_configuration"
  end
  # resource path
  local_var_path = "/configurations"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(configuration)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'APIConfigurationPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigurationsApi#create_api_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_all_api_configurations(opts = {}) click to toggle source

Returns a collection of configurations. By default 10 values are returned. Records are returned in natural order. {"nickname":"Get all configurations","response":"getConfigurationsAll.html"} @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first pricing-component to return. (default to 0) @option opts [Integer] :records The maximum number of pricing-components to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @return [APIConfigurationPagedMetadata]

# File lib/bf_ruby2/api/configurations_api.rb, line 87
def get_all_api_configurations(opts = {})
  data, _status_code, _headers = get_all_api_configurations_with_http_info(opts)
  return data
end
get_all_api_configurations_with_http_info(opts = {}) click to toggle source

Returns a collection of configurations. By default 10 values are returned. Records are returned in natural order. {&quot;nickname&quot;:&quot;Get all configurations&quot;,&quot;response&quot;:&quot;getConfigurationsAll.html&quot;} @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first pricing-component to return. @option opts [Integer] :records The maximum number of pricing-components to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @return [Array<(APIConfigurationPagedMetadata, Fixnum, Hash)>] APIConfigurationPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/configurations_api.rb, line 101
def get_all_api_configurations_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ConfigurationsApi.get_all_api_configurations ..."
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/configurations"

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'APIConfigurationPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigurationsApi#get_all_api_configurations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_api_configurations_by_type(configuration_type, opts = {}) click to toggle source

Returns a single configuration, specified by the type parameter. {"nickname":"Retrieve by payment gateway","response":"getConfigurationByType.html"} @param configuration_type The unique type of the configuration. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first pricing-component to return. (default to 0) @option opts [Integer] :records The maximum number of pricing-components to return. (default to 10) @option opts [String] :order_by Specify a field used to order the result set. (default to created) @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. (default to DESC) @return [APIConfigurationPagedMetadata]

# File lib/bf_ruby2/api/configurations_api.rb, line 153
def get_api_configurations_by_type(configuration_type, opts = {})
  data, _status_code, _headers = get_api_configurations_by_type_with_http_info(configuration_type, opts)
  return data
end
get_api_configurations_by_type_with_http_info(configuration_type, opts = {}) click to toggle source

Returns a single configuration, specified by the type parameter. {&quot;nickname&quot;:&quot;Retrieve by payment gateway&quot;,&quot;response&quot;:&quot;getConfigurationByType.html&quot;} @param configuration_type The unique type of the configuration. @param [Hash] opts the optional parameters @option opts [Array<String>] :organizations A list of organization-IDs used to restrict the scope of API calls. @option opts [Integer] :offset The offset from the first pricing-component to return. @option opts [Integer] :records The maximum number of pricing-components to return. @option opts [String] :order_by Specify a field used to order the result set. @option opts [String] :order Ihe direction of any ordering, either ASC or DESC. @return [Array<(APIConfigurationPagedMetadata, Fixnum, Hash)>] APIConfigurationPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/configurations_api.rb, line 168
def get_api_configurations_by_type_with_http_info(configuration_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ConfigurationsApi.get_api_configurations_by_type ..."
  end
  # verify the required parameter 'configuration_type' is set
  if @api_client.config.client_side_validation && configuration_type.nil?
    fail ArgumentError, "Missing the required parameter 'configuration_type' when calling ConfigurationsApi.get_api_configurations_by_type"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['Balanced', 'Braintree', 'Cybersource', 'Paypal', 'Stripe', 'AuthorizeNet', 'Spreedly', 'SagePay', 'TrustCommerce', 'Payvision', 'Kash'].include?(configuration_type)
    fail ArgumentError, "invalid value for 'configuration_type', must be one of Balanced, Braintree, Cybersource, Paypal, Stripe, AuthorizeNet, Spreedly, SagePay, TrustCommerce, Payvision, Kash"
  end
  if @api_client.config.client_side_validation && opts[:'order'] && !['ASC', 'DESC'].include?(opts[:'order'])
    fail ArgumentError, 'invalid value for "order", must be one of ASC, DESC'
  end
  # resource path
  local_var_path = "/configurations/type/{configuration-type}".sub('{' + 'configuration-type' + '}', configuration_type.to_s)

  # query parameters
  query_params = {}
  query_params[:'organizations'] = @api_client.build_collection_param(opts[:'organizations'], :multi) if !opts[:'organizations'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'records'] = opts[:'records'] if !opts[:'records'].nil?
  query_params[:'order_by'] = opts[:'order_by'] if !opts[:'order_by'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'APIConfigurationPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigurationsApi#get_api_configurations_by_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_api_configuration(configuration, opts = {}) click to toggle source

Update a configuration. {"nickname":"Update a configuration","request":"updateConfigurationRequest.html","response":"updateConfigurationResponse.html"} @param configuration The configuration object to be updated. @param [Hash] opts the optional parameters @return [APIConfigurationPagedMetadata]

# File lib/bf_ruby2/api/configurations_api.rb, line 223
def update_api_configuration(configuration, opts = {})
  data, _status_code, _headers = update_api_configuration_with_http_info(configuration, opts)
  return data
end
update_api_configuration_with_http_info(configuration, opts = {}) click to toggle source

Update a configuration. {&quot;nickname&quot;:&quot;Update a configuration&quot;,&quot;request&quot;:&quot;updateConfigurationRequest.html&quot;,&quot;response&quot;:&quot;updateConfigurationResponse.html&quot;} @param configuration The configuration object to be updated. @param [Hash] opts the optional parameters @return [Array<(APIConfigurationPagedMetadata, Fixnum, Hash)>] APIConfigurationPagedMetadata data, response status code and response headers

# File lib/bf_ruby2/api/configurations_api.rb, line 233
def update_api_configuration_with_http_info(configuration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ConfigurationsApi.update_api_configuration ..."
  end
  # verify the required parameter 'configuration' is set
  if @api_client.config.client_side_validation && configuration.nil?
    fail ArgumentError, "Missing the required parameter 'configuration' when calling ConfigurationsApi.update_api_configuration"
  end
  # resource path
  local_var_path = "/configurations"

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/xml', 'application/xml', 'application/json; charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json; charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(configuration)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'APIConfigurationPagedMetadata')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ConfigurationsApi#update_api_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end