Class: OCI::DatabaseManagement::Models::AssociatedComponent

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/associated_component.rb

Overview

The details of the associated component.

Constant Summary collapse

COMPONENT_TYPE_ENUM =
[
  COMPONENT_TYPE_ASM = 'ASM'.freeze,
  COMPONENT_TYPE_ASM_INSTANCE = 'ASM_INSTANCE'.freeze,
  COMPONENT_TYPE_CLUSTER = 'CLUSTER'.freeze,
  COMPONENT_TYPE_CLUSTER_INSTANCE = 'CLUSTER_INSTANCE'.freeze,
  COMPONENT_TYPE_DATABASE = 'DATABASE'.freeze,
  COMPONENT_TYPE_DATABASE_INSTANCE = 'DATABASE_INSTANCE'.freeze,
  COMPONENT_TYPE_DATABASE_HOME = 'DATABASE_HOME'.freeze,
  COMPONENT_TYPE_DATABASE_NODE = 'DATABASE_NODE'.freeze,
  COMPONENT_TYPE_DBSYSTEM = 'DBSYSTEM'.freeze,
  COMPONENT_TYPE_LISTENER = 'LISTENER'.freeze,
  COMPONENT_TYPE_PLUGGABLE_DATABASE = 'PLUGGABLE_DATABASE'.freeze,
  COMPONENT_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ASSOCIATION_TYPE_ENUM =
[
  ASSOCIATION_TYPE_CONTAINS = 'CONTAINS'.freeze,
  ASSOCIATION_TYPE_USES = 'USES'.freeze,
  ASSOCIATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AssociatedComponent

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :component_id (String)

    The value to assign to the #component_id property

  • :component_type (String)

    The value to assign to the #component_type property

  • :association_type (String)

    The value to assign to the #association_type property



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oci/database_management/models/associated_component.rb', line 76

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.component_id = attributes[:'componentId'] if attributes[:'componentId']

  raise 'You cannot provide both :componentId and :component_id' if attributes.key?(:'componentId') && attributes.key?(:'component_id')

  self.component_id = attributes[:'component_id'] if attributes[:'component_id']

  self.component_type = attributes[:'componentType'] if attributes[:'componentType']

  raise 'You cannot provide both :componentType and :component_type' if attributes.key?(:'componentType') && attributes.key?(:'component_type')

  self.component_type = attributes[:'component_type'] if attributes[:'component_type']

  self.association_type = attributes[:'associationType'] if attributes[:'associationType']

  raise 'You cannot provide both :associationType and :association_type' if attributes.key?(:'associationType') && attributes.key?(:'association_type')

  self.association_type = attributes[:'association_type'] if attributes[:'association_type']
end

Instance Attribute Details

#association_typeString

[Required] The association type.

Returns:

  • (String)


43
44
45
# File 'lib/oci/database_management/models/associated_component.rb', line 43

def association_type
  @association_type
end

#component_idString

[Required] The identifier of the associated component.

Returns:

  • (String)


35
36
37
# File 'lib/oci/database_management/models/associated_component.rb', line 35

def component_id
  @component_id
end

#component_typeString

The type of associated component.

Returns:

  • (String)


39
40
41
# File 'lib/oci/database_management/models/associated_component.rb', line 39

def component_type
  @component_type
end

Class Method Details

.attribute_mapObject

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



46
47
48
49
50
51
52
53
54
# File 'lib/oci/database_management/models/associated_component.rb', line 46

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'component_id': :'componentId',
    'component_type': :'componentType',
    'association_type': :'associationType'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



57
58
59
60
61
62
63
64
65
# File 'lib/oci/database_management/models/associated_component.rb', line 57

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'component_id': :'String',
    'component_type': :'String',
    'association_type': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



134
135
136
137
138
139
140
141
# File 'lib/oci/database_management/models/associated_component.rb', line 134

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    component_id == other.component_id &&
    component_type == other.component_type &&
    association_type == other.association_type
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/oci/database_management/models/associated_component.rb', line 166

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

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


146
147
148
# File 'lib/oci/database_management/models/associated_component.rb', line 146

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



155
156
157
# File 'lib/oci/database_management/models/associated_component.rb', line 155

def hash
  [component_id, component_type, association_type].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



199
200
201
202
203
204
205
206
207
208
# File 'lib/oci/database_management/models/associated_component.rb', line 199

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



193
194
195
# File 'lib/oci/database_management/models/associated_component.rb', line 193

def to_s
  to_hash.to_s
end