Class: OCI::OsManagementHub::Models::MirrorSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management_hub/models/mirror_summary.rb

Overview

Summary of a Mirror

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_CUSTOM = 'CUSTOM'.freeze,
  TYPE_VENDOR = 'VENDOR'.freeze,
  TYPE_VERSIONED = 'VERSIONED'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OS_FAMILY_ENUM =
[
  OS_FAMILY_ORACLE_LINUX_9 = 'ORACLE_LINUX_9'.freeze,
  OS_FAMILY_ORACLE_LINUX_8 = 'ORACLE_LINUX_8'.freeze,
  OS_FAMILY_ORACLE_LINUX_7 = 'ORACLE_LINUX_7'.freeze,
  OS_FAMILY_ORACLE_LINUX_6 = 'ORACLE_LINUX_6'.freeze,
  OS_FAMILY_WINDOWS_SERVER_2016 = 'WINDOWS_SERVER_2016'.freeze,
  OS_FAMILY_WINDOWS_SERVER_2019 = 'WINDOWS_SERVER_2019'.freeze,
  OS_FAMILY_WINDOWS_SERVER_2022 = 'WINDOWS_SERVER_2022'.freeze,
  OS_FAMILY_ALL = 'ALL'.freeze,
  OS_FAMILY_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ARCH_TYPE_ENUM =
[
  ARCH_TYPE_X86_64 = 'X86_64'.freeze,
  ARCH_TYPE_AARCH64 = 'AARCH64'.freeze,
  ARCH_TYPE_I686 = 'I686'.freeze,
  ARCH_TYPE_NOARCH = 'NOARCH'.freeze,
  ARCH_TYPE_SRC = 'SRC'.freeze,
  ARCH_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
STATE_ENUM =
[
  STATE_UNSYNCED = 'UNSYNCED'.freeze,
  STATE_QUEUED = 'QUEUED'.freeze,
  STATE_SYNCING = 'SYNCING'.freeze,
  STATE_SYNCED = 'SYNCED'.freeze,
  STATE_FAILED = 'FAILED'.freeze,
  STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MirrorSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :id (String)

    The value to assign to the #id property

  • :display_name (String)

    The value to assign to the #display_name property

  • :type (String)

    The value to assign to the #type property

  • :os_family (String)

    The value to assign to the #os_family property

  • :arch_type (String)

    The value to assign to the #arch_type property

  • :state (String)

    The value to assign to the #state property

  • :percentage (Integer)

    The value to assign to the #percentage property

  • :time_last_synced (DateTime)

    The value to assign to the #time_last_synced property

  • :log (String)

    The value to assign to the #log property



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 134

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

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

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

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

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

  self.os_family = attributes[:'osFamily'] if attributes[:'osFamily']

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

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

  self.arch_type = attributes[:'archType'] if attributes[:'archType']

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

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

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

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

  self.time_last_synced = attributes[:'timeLastSynced'] if attributes[:'timeLastSynced']

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

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

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

Instance Attribute Details

#arch_typeString

The architecture type supported by the Software Source

Returns:

  • (String)


67
68
69
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 67

def arch_type
  @arch_type
end

#display_nameString

Display name of the mirror

Returns:

  • (String)


55
56
57
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 55

def display_name
  @display_name
end

#idString

[Required] OCID of a software source

Returns:

  • (String)


51
52
53
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 51

def id
  @id
end

#logString

[Required] The current log from the management station plugin.

Returns:

  • (String)


83
84
85
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 83

def log
  @log
end

#os_familyString

The OS family the Software Source belongs to

Returns:

  • (String)


63
64
65
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 63

def os_family
  @os_family
end

#percentageInteger

[Required] A decimal number representing the completness percentage

Returns:

  • (Integer)


75
76
77
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 75

def percentage
  @percentage
end

#stateString

[Required] Current state of the mirror

Returns:

  • (String)


71
72
73
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 71

def state
  @state
end

#time_last_syncedDateTime

[Required] Timestamp of the last time the mirror was sync

Returns:

  • (DateTime)


79
80
81
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 79

def time_last_synced
  @time_last_synced
end

#typeString

Type of the mirror

Returns:

  • (String)


59
60
61
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 59

def type
  @type
end

Class Method Details

.attribute_mapObject

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



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 86

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'display_name': :'displayName',
    'type': :'type',
    'os_family': :'osFamily',
    'arch_type': :'archType',
    'state': :'state',
    'percentage': :'percentage',
    'time_last_synced': :'timeLastSynced',
    'log': :'log'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 103

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'display_name': :'String',
    'type': :'String',
    'os_family': :'String',
    'arch_type': :'String',
    'state': :'String',
    'percentage': :'Integer',
    'time_last_synced': :'DateTime',
    'log': :'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



234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 234

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

  self.class == other.class &&
    id == other.id &&
    display_name == other.display_name &&
    type == other.type &&
    os_family == other.os_family &&
    arch_type == other.arch_type &&
    state == other.state &&
    percentage == other.percentage &&
    time_last_synced == other.time_last_synced &&
    log == other.log
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



272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 272

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


252
253
254
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 252

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



261
262
263
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 261

def hash
  [id, display_name, type, os_family, arch_type, state, percentage, time_last_synced, log].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



305
306
307
308
309
310
311
312
313
314
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 305

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



299
300
301
# File 'lib/oci/os_management_hub/models/mirror_summary.rb', line 299

def to_s
  to_hash.to_s
end