class OCI::DataIntegration::Models::ConfigParameterValue
Contains the parameter configuration values.
Attributes
An integer value of the parameter. @return [Integer]
An object value of the parameter. @return [Object]
Reference to the parameter by its key. @return [String]
The root object reference value. @return [Object]
The root object value, used in custom parameters. @return [Object]
A string value of the parameter. @return [String]
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/oci/data_integration/models/config_parameter_value.rb, line 35 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'string_value': :'stringValue', 'int_value': :'intValue', 'object_value': :'objectValue', 'ref_value': :'refValue', 'parameter_value': :'parameterValue', 'root_object_value': :'rootObjectValue' # rubocop:enable Style/SymbolLiteral } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :string_value The value to assign to the {#string_value} property @option attributes [Integer] :int_value The value to assign to the {#int_value} property @option attributes [Object] :object_value The value to assign to the {#object_value} property @option attributes [Object] :ref_value The value to assign to the {#ref_value} property @option attributes [String] :parameter_value The value to assign to the {#parameter_value} property @option attributes [Object] :root_object_value The value to assign to the {#root_object_value} property
# File lib/oci/data_integration/models/config_parameter_value.rb, line 74 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 } self.string_value = attributes[:'stringValue'] if attributes[:'stringValue'] raise 'You cannot provide both :stringValue and :string_value' if attributes.key?(:'stringValue') && attributes.key?(:'string_value') self.string_value = attributes[:'string_value'] if attributes[:'string_value'] self.int_value = attributes[:'intValue'] if attributes[:'intValue'] raise 'You cannot provide both :intValue and :int_value' if attributes.key?(:'intValue') && attributes.key?(:'int_value') self.int_value = attributes[:'int_value'] if attributes[:'int_value'] self.object_value = attributes[:'objectValue'] if attributes[:'objectValue'] raise 'You cannot provide both :objectValue and :object_value' if attributes.key?(:'objectValue') && attributes.key?(:'object_value') self.object_value = attributes[:'object_value'] if attributes[:'object_value'] self.ref_value = attributes[:'refValue'] if attributes[:'refValue'] raise 'You cannot provide both :refValue and :ref_value' if attributes.key?(:'refValue') && attributes.key?(:'ref_value') self.ref_value = attributes[:'ref_value'] if attributes[:'ref_value'] self.parameter_value = attributes[:'parameterValue'] if attributes[:'parameterValue'] raise 'You cannot provide both :parameterValue and :parameter_value' if attributes.key?(:'parameterValue') && attributes.key?(:'parameter_value') self.parameter_value = attributes[:'parameter_value'] if attributes[:'parameter_value'] self.root_object_value = attributes[:'rootObjectValue'] if attributes[:'rootObjectValue'] raise 'You cannot provide both :rootObjectValue and :root_object_value' if attributes.key?(:'rootObjectValue') && attributes.key?(:'root_object_value') self.root_object_value = attributes[:'root_object_value'] if attributes[:'root_object_value'] end
Attribute type mapping.
# File lib/oci/data_integration/models/config_parameter_value.rb, line 49 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'string_value': :'String', 'int_value': :'Integer', 'object_value': :'Object', 'ref_value': :'Object', 'parameter_value': :'String', 'root_object_value': :'Object' # rubocop:enable Style/SymbolLiteral } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] other the other object to be compared
# File lib/oci/data_integration/models/config_parameter_value.rb, line 124 def ==(other) return true if equal?(other) self.class == other.class && string_value == other.string_value && int_value == other.int_value && object_value == other.object_value && ref_value == other.ref_value && parameter_value == other.parameter_value && root_object_value == other.root_object_value end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/oci/data_integration/models/config_parameter_value.rb, line 159 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/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) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(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
@see the `==` method @param [Object] other the other object to be compared
# File lib/oci/data_integration/models/config_parameter_value.rb, line 139 def eql?(other) self == other end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/oci/data_integration/models/config_parameter_value.rb, line 148 def hash [string_value, int_value, object_value, ref_value, parameter_value, root_object_value].hash end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/oci/data_integration/models/config_parameter_value.rb, line 192 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/oci/data_integration/models/config_parameter_value.rb, line 186 def to_s to_hash.to_s end
Private Instance Methods
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/oci/data_integration/models/config_parameter_value.rb, line 209 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