class SwaggerAemOsgiClient::OrgApacheSlingDatasourceDataSourceFactoryProperties

Attributes

connection_properties[RW]
datasource_name[RW]
datasource_svc_prop_name[RW]
datasource_svc_properties[RW]
default_auto_commit[RW]
default_catalog[RW]
default_read_only[RW]
default_transaction_isolation[RW]
driver_class_name[RW]
init_sql[RW]
initial_size[RW]
jdbc_interceptors[RW]
log_validation_errors[RW]
max_active[RW]
max_age[RW]
max_idle[RW]
max_wait[RW]
min_evictable_idle_time_millis[RW]
min_idle[RW]
password[RW]
test_on_borrow[RW]
test_on_return[RW]
test_while_idle[RW]
time_between_eviction_runs_millis[RW]
url[RW]
username[RW]
validation_interval[RW]
validation_query[RW]
validation_query_timeout[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 76
def self.attribute_map
  {
    :'datasource_name' => :'datasource.name',
    :'datasource_svc_prop_name' => :'datasource.svc.prop.name',
    :'driver_class_name' => :'driverClassName',
    :'url' => :'url',
    :'username' => :'username',
    :'password' => :'password',
    :'default_auto_commit' => :'defaultAutoCommit',
    :'default_read_only' => :'defaultReadOnly',
    :'default_transaction_isolation' => :'defaultTransactionIsolation',
    :'default_catalog' => :'defaultCatalog',
    :'max_active' => :'maxActive',
    :'max_idle' => :'maxIdle',
    :'min_idle' => :'minIdle',
    :'initial_size' => :'initialSize',
    :'max_wait' => :'maxWait',
    :'max_age' => :'maxAge',
    :'test_on_borrow' => :'testOnBorrow',
    :'test_on_return' => :'testOnReturn',
    :'test_while_idle' => :'testWhileIdle',
    :'validation_query' => :'validationQuery',
    :'validation_query_timeout' => :'validationQueryTimeout',
    :'time_between_eviction_runs_millis' => :'timeBetweenEvictionRunsMillis',
    :'min_evictable_idle_time_millis' => :'minEvictableIdleTimeMillis',
    :'connection_properties' => :'connectionProperties',
    :'init_sql' => :'initSQL',
    :'jdbc_interceptors' => :'jdbcInterceptors',
    :'validation_interval' => :'validationInterval',
    :'log_validation_errors' => :'logValidationErrors',
    :'datasource_svc_properties' => :'datasource.svc.properties'
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 147
def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'datasource.name')
    self.datasource_name = attributes[:'datasource.name']
  end

  if attributes.has_key?(:'datasource.svc.prop.name')
    self.datasource_svc_prop_name = attributes[:'datasource.svc.prop.name']
  end

  if attributes.has_key?(:'driverClassName')
    self.driver_class_name = attributes[:'driverClassName']
  end

  if attributes.has_key?(:'url')
    self.url = attributes[:'url']
  end

  if attributes.has_key?(:'username')
    self.username = attributes[:'username']
  end

  if attributes.has_key?(:'password')
    self.password = attributes[:'password']
  end

  if attributes.has_key?(:'defaultAutoCommit')
    self.default_auto_commit = attributes[:'defaultAutoCommit']
  end

  if attributes.has_key?(:'defaultReadOnly')
    self.default_read_only = attributes[:'defaultReadOnly']
  end

  if attributes.has_key?(:'defaultTransactionIsolation')
    self.default_transaction_isolation = attributes[:'defaultTransactionIsolation']
  end

  if attributes.has_key?(:'defaultCatalog')
    self.default_catalog = attributes[:'defaultCatalog']
  end

  if attributes.has_key?(:'maxActive')
    self.max_active = attributes[:'maxActive']
  end

  if attributes.has_key?(:'maxIdle')
    self.max_idle = attributes[:'maxIdle']
  end

  if attributes.has_key?(:'minIdle')
    self.min_idle = attributes[:'minIdle']
  end

  if attributes.has_key?(:'initialSize')
    self.initial_size = attributes[:'initialSize']
  end

  if attributes.has_key?(:'maxWait')
    self.max_wait = attributes[:'maxWait']
  end

  if attributes.has_key?(:'maxAge')
    self.max_age = attributes[:'maxAge']
  end

  if attributes.has_key?(:'testOnBorrow')
    self.test_on_borrow = attributes[:'testOnBorrow']
  end

  if attributes.has_key?(:'testOnReturn')
    self.test_on_return = attributes[:'testOnReturn']
  end

  if attributes.has_key?(:'testWhileIdle')
    self.test_while_idle = attributes[:'testWhileIdle']
  end

  if attributes.has_key?(:'validationQuery')
    self.validation_query = attributes[:'validationQuery']
  end

  if attributes.has_key?(:'validationQueryTimeout')
    self.validation_query_timeout = attributes[:'validationQueryTimeout']
  end

  if attributes.has_key?(:'timeBetweenEvictionRunsMillis')
    self.time_between_eviction_runs_millis = attributes[:'timeBetweenEvictionRunsMillis']
  end

  if attributes.has_key?(:'minEvictableIdleTimeMillis')
    self.min_evictable_idle_time_millis = attributes[:'minEvictableIdleTimeMillis']
  end

  if attributes.has_key?(:'connectionProperties')
    self.connection_properties = attributes[:'connectionProperties']
  end

  if attributes.has_key?(:'initSQL')
    self.init_sql = attributes[:'initSQL']
  end

  if attributes.has_key?(:'jdbcInterceptors')
    self.jdbc_interceptors = attributes[:'jdbcInterceptors']
  end

  if attributes.has_key?(:'validationInterval')
    self.validation_interval = attributes[:'validationInterval']
  end

  if attributes.has_key?(:'logValidationErrors')
    self.log_validation_errors = attributes[:'logValidationErrors']
  end

  if attributes.has_key?(:'datasource.svc.properties')
    self.datasource_svc_properties = attributes[:'datasource.svc.properties']
  end
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 111
def self.openapi_types
  {
    :'datasource_name' => :'ConfigNodePropertyString',
    :'datasource_svc_prop_name' => :'ConfigNodePropertyString',
    :'driver_class_name' => :'ConfigNodePropertyString',
    :'url' => :'ConfigNodePropertyString',
    :'username' => :'ConfigNodePropertyString',
    :'password' => :'ConfigNodePropertyString',
    :'default_auto_commit' => :'ConfigNodePropertyDropDown',
    :'default_read_only' => :'ConfigNodePropertyDropDown',
    :'default_transaction_isolation' => :'ConfigNodePropertyDropDown',
    :'default_catalog' => :'ConfigNodePropertyString',
    :'max_active' => :'ConfigNodePropertyInteger',
    :'max_idle' => :'ConfigNodePropertyInteger',
    :'min_idle' => :'ConfigNodePropertyInteger',
    :'initial_size' => :'ConfigNodePropertyInteger',
    :'max_wait' => :'ConfigNodePropertyInteger',
    :'max_age' => :'ConfigNodePropertyInteger',
    :'test_on_borrow' => :'ConfigNodePropertyBoolean',
    :'test_on_return' => :'ConfigNodePropertyBoolean',
    :'test_while_idle' => :'ConfigNodePropertyBoolean',
    :'validation_query' => :'ConfigNodePropertyString',
    :'validation_query_timeout' => :'ConfigNodePropertyInteger',
    :'time_between_eviction_runs_millis' => :'ConfigNodePropertyInteger',
    :'min_evictable_idle_time_millis' => :'ConfigNodePropertyInteger',
    :'connection_properties' => :'ConfigNodePropertyString',
    :'init_sql' => :'ConfigNodePropertyString',
    :'jdbc_interceptors' => :'ConfigNodePropertyString',
    :'validation_interval' => :'ConfigNodePropertyInteger',
    :'log_validation_errors' => :'ConfigNodePropertyBoolean',
    :'datasource_svc_properties' => :'ConfigNodePropertyArray'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 285
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      datasource_name == o.datasource_name &&
      datasource_svc_prop_name == o.datasource_svc_prop_name &&
      driver_class_name == o.driver_class_name &&
      url == o.url &&
      username == o.username &&
      password == o.password &&
      default_auto_commit == o.default_auto_commit &&
      default_read_only == o.default_read_only &&
      default_transaction_isolation == o.default_transaction_isolation &&
      default_catalog == o.default_catalog &&
      max_active == o.max_active &&
      max_idle == o.max_idle &&
      min_idle == o.min_idle &&
      initial_size == o.initial_size &&
      max_wait == o.max_wait &&
      max_age == o.max_age &&
      test_on_borrow == o.test_on_borrow &&
      test_on_return == o.test_on_return &&
      test_while_idle == o.test_while_idle &&
      validation_query == o.validation_query &&
      validation_query_timeout == o.validation_query_timeout &&
      time_between_eviction_runs_millis == o.time_between_eviction_runs_millis &&
      min_evictable_idle_time_millis == o.min_evictable_idle_time_millis &&
      connection_properties == o.connection_properties &&
      init_sql == o.init_sql &&
      jdbc_interceptors == o.jdbc_interceptors &&
      validation_interval == o.validation_interval &&
      log_validation_errors == o.log_validation_errors &&
      datasource_svc_properties == o.datasource_svc_properties
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 355
def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = SwaggerAemOsgiClient.const_get(type).new
    temp_model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 421
def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 334
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 321
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 327
def hash
  [datasource_name, datasource_svc_prop_name, driver_class_name, url, username, password, default_auto_commit, default_read_only, default_transaction_isolation, default_catalog, max_active, max_idle, min_idle, initial_size, max_wait, max_age, test_on_borrow, test_on_return, test_while_idle, validation_query, validation_query_timeout, time_between_eviction_runs_millis, min_evictable_idle_time_millis, connection_properties, init_sql, jdbc_interceptors, validation_interval, log_validation_errors, datasource_svc_properties].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 272
def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 401
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 407
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end
to_s() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 395
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/swagger_aem_osgi/models/org_apache_sling_datasource_data_source_factory_properties.rb, line 279
def valid?
  true
end