Class: OCI::FleetSoftwareUpdate::Models::TargetSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/fleet_software_update/models/target_summary.rb

Overview

Details of a target member of a Exadata Fleet Update Collection.

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_IDLE = 'IDLE'.freeze,
  STATUS_EXECUTING_JOB = 'EXECUTING_JOB'.freeze,
  STATUS_JOB_FAILED = 'JOB_FAILED'.freeze,
  STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ TargetSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 86

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

  self.current_version = attributes[:'currentVersion'] if attributes[:'currentVersion']

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

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

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

  self.executing_fsu_job_id = attributes[:'executingFsuJobId'] if attributes[:'executingFsuJobId']

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

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

  self.active_fsu_cycle_id = attributes[:'activeFsuCycleId'] if attributes[:'activeFsuCycleId']

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

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

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

Instance Attribute Details

#active_fsu_cycle_idString

Active Exadata Fleet Update Cycle OCID. Null if no Cycle is active that has this target as member.

Returns:

  • (String)


41
42
43
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 41

def active_fsu_cycle_id
  @active_fsu_cycle_id
end

#current_versionString

Current version of the target

Returns:

  • (String)


26
27
28
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 26

def current_version
  @current_version
end

#executing_fsu_job_idString

Exadata Fleet Update Job OCID executing an action in the target. Null if no job is being executed.

Returns:

  • (String)


36
37
38
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 36

def executing_fsu_job_id
  @executing_fsu_job_id
end

#progressOCI::FleetSoftwareUpdate::Models::TargetProgressSummary



44
45
46
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 44

def progress
  @progress
end

#statusString

Status of the target in the Exadata Fleet Update Collection.

Returns:

  • (String)


31
32
33
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 31

def status
  @status
end

#targetOCI::FleetSoftwareUpdate::Models::TargetDetails



21
22
23
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 21

def target
  @target
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 47

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'target': :'target',
    'current_version': :'currentVersion',
    'status': :'status',
    'executing_fsu_job_id': :'executingFsuJobId',
    'active_fsu_cycle_id': :'activeFsuCycleId',
    'progress': :'progress'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 61

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'target': :'OCI::FleetSoftwareUpdate::Models::TargetDetails',
    'current_version': :'String',
    'status': :'String',
    'executing_fsu_job_id': :'String',
    'active_fsu_cycle_id': :'String',
    'progress': :'OCI::FleetSoftwareUpdate::Models::TargetProgressSummary'
    # 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



137
138
139
140
141
142
143
144
145
146
147
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 137

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

  self.class == other.class &&
    target == other.target &&
    current_version == other.current_version &&
    status == other.status &&
    executing_fsu_job_id == other.executing_fsu_job_id &&
    active_fsu_cycle_id == other.active_fsu_cycle_id &&
    progress == other.progress
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



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 172

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


152
153
154
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 152

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



161
162
163
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 161

def hash
  [target, current_version, status, executing_fsu_job_id, active_fsu_cycle_id, progress].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



205
206
207
208
209
210
211
212
213
214
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 205

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



199
200
201
# File 'lib/oci/fleet_software_update/models/target_summary.rb', line 199

def to_s
  to_hash.to_s
end