Class: OCI::FleetSoftwareUpdate::Models::GiGoalSoftwareComponentDetails

Inherits:
GoalSoftwareComponentDetails show all
Defined in:
lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb

Overview

Details of goal version for 'GI' component in an 'EXADB_STACK' type Exadata Fleet Update Collection.

Constant Summary collapse

HOME_POLICY_ENUM =
[
  HOME_POLICY_CREATE_NEW = 'CREATE_NEW'.freeze,
  HOME_POLICY_USE_EXISTING = 'USE_EXISTING'.freeze,
  HOME_POLICY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Constants inherited from GoalSoftwareComponentDetails

OCI::FleetSoftwareUpdate::Models::GoalSoftwareComponentDetails::COMPONENT_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from GoalSoftwareComponentDetails

#component_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GoalSoftwareComponentDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ GiGoalSoftwareComponentDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 74

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['componentType'] = 'GI'

  super(attributes)

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

  self.goal_version_details = attributes[:'goalVersionDetails'] if attributes[:'goalVersionDetails']

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

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

  self.home_policy = attributes[:'homePolicy'] if attributes[:'homePolicy']
  self.home_policy = "CREATE_NEW" if home_policy.nil? && !attributes.key?(:'homePolicy') # rubocop:disable Style/StringLiterals

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

  self.home_policy = attributes[:'home_policy'] if attributes[:'home_policy']
  self.home_policy = "CREATE_NEW" if home_policy.nil? && !attributes.key?(:'homePolicy') && !attributes.key?(:'home_policy') # rubocop:disable Style/StringLiterals

  self.new_home_prefix = attributes[:'newHomePrefix'] if attributes[:'newHomePrefix']

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

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

Instance Attribute Details

#goal_version_detailsOCI::FleetSoftwareUpdate::Models::GiGoalVersionDetails

This attribute is required.



22
23
24
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 22

def goal_version_details
  @goal_version_details
end

#home_policyString

Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random.

Returns:

  • (String)


32
33
34
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 32

def home_policy
  @home_policy
end

#new_home_prefixString

Prefix name used for new DB home resources created as part of the Stage Action. Format: <specified_prefix>_<timestamp> If not specified, a default OCI DB home resource will be generated for the new DB home resources created.

Returns:

  • (String)


39
40
41
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 39

def new_home_prefix
  @new_home_prefix
end

Class Method Details

.attribute_mapObject

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



42
43
44
45
46
47
48
49
50
51
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 42

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'component_type': :'componentType',
    'goal_version_details': :'goalVersionDetails',
    'home_policy': :'homePolicy',
    'new_home_prefix': :'newHomePrefix'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 54

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'component_type': :'String',
    'goal_version_details': :'OCI::FleetSoftwareUpdate::Models::GiGoalVersionDetails',
    'home_policy': :'String',
    'new_home_prefix': :'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



125
126
127
128
129
130
131
132
133
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 125

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

  self.class == other.class &&
    component_type == other.component_type &&
    goal_version_details == other.goal_version_details &&
    home_policy == other.home_policy &&
    new_home_prefix == other.new_home_prefix
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



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 158

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


138
139
140
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 138

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



147
148
149
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 147

def hash
  [component_type, goal_version_details, home_policy, new_home_prefix].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 191

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



185
186
187
# File 'lib/oci/fleet_software_update/models/gi_goal_software_component_details.rb', line 185

def to_s
  to_hash.to_s
end