Class: OCI::Mngdmac::Models::MacDeviceSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/mngdmac/models/mac_device_summary.rb

Overview

Summary information about a MacDevice.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MacDeviceSummary

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

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :mac_order_id (String)

    The value to assign to the #mac_order_id property

  • :serial_number (String)

    The value to assign to the #serial_number property

  • :ip_address (String)

    The value to assign to the #ip_address property

  • :shape (String)

    The value to assign to the #shape property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :is_marked_decom (BOOLEAN)

    The value to assign to the #is_marked_decom property

  • :time_decom (DateTime)

    The value to assign to the #time_decom property



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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
174
175
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 110

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

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

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

  self.mac_order_id = attributes[:'macOrderId'] if attributes[:'macOrderId']

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

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

  self.serial_number = attributes[:'serialNumber'] if attributes[:'serialNumber']

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

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

  self.ip_address = attributes[:'ipAddress'] if attributes[:'ipAddress']

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

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

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

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

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

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

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

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

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

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

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

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

  self.is_marked_decom = attributes[:'isMarkedDecom'] unless attributes[:'isMarkedDecom'].nil?
  self.is_marked_decom = false if is_marked_decom.nil? && !attributes.key?(:'isMarkedDecom') # rubocop:disable Style/StringLiterals

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

  self.is_marked_decom = attributes[:'is_marked_decom'] unless attributes[:'is_marked_decom'].nil?
  self.is_marked_decom = false if is_marked_decom.nil? && !attributes.key?(:'isMarkedDecom') && !attributes.key?(:'is_marked_decom') # rubocop:disable Style/StringLiterals

  self.time_decom = attributes[:'timeDecom'] if attributes[:'timeDecom']

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

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

Instance Attribute Details

#compartment_idString

[Required] OCID of the compartment to which the resource belongs to.

Returns:

  • (String)


17
18
19
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 17

def compartment_id
  @compartment_id
end

#idString

[Required] The unique ID of the MacDevice.

Returns:

  • (String)


13
14
15
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 13

def id
  @id
end

#ip_addressString

[Required] The IP address assigned to the MacDevice.

Returns:

  • (String)


29
30
31
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 29

def ip_address
  @ip_address
end

#is_marked_decomBOOLEAN

[Required] A flag that indicates if this MacDevice is decommissioned.

Returns:

  • (BOOLEAN)


49
50
51
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 49

def is_marked_decom
  @is_marked_decom
end

#lifecycle_stateString

[Required] The current status of the MacDevice.

Returns:

  • (String)


37
38
39
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 37

def lifecycle_state
  @lifecycle_state
end

#mac_order_idString

[Required] The OCID of the resource.

Returns:

  • (String)


21
22
23
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 21

def mac_order_id
  @mac_order_id
end

#serial_numberString

[Required] The serial number of the MacDevice.

Returns:

  • (String)


25
26
27
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 25

def serial_number
  @serial_number
end

#shapeString

[Required] The shape of the MacDevice.

Returns:

  • (String)


33
34
35
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 33

def shape
  @shape
end

#time_createdDateTime

[Required] The time this resource was created. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


41
42
43
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 41

def time_created
  @time_created
end

#time_decomDateTime

[Required] An RFC3339-formatted datetime string containing the time this MacDevice was decommissioned.

Returns:

  • (DateTime)


53
54
55
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 53

def time_decom
  @time_decom
end

#time_updatedDateTime

[Required] The time this resource was last updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


45
46
47
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 45

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'mac_order_id': :'macOrderId',
    'serial_number': :'serialNumber',
    'ip_address': :'ipAddress',
    'shape': :'shape',
    'lifecycle_state': :'lifecycleState',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'is_marked_decom': :'isMarkedDecom',
    'time_decom': :'timeDecom'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'mac_order_id': :'String',
    'serial_number': :'String',
    'ip_address': :'String',
    'shape': :'String',
    'lifecycle_state': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'is_marked_decom': :'BOOLEAN',
    'time_decom': :'DateTime'
    # 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



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 184

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

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    mac_order_id == other.mac_order_id &&
    serial_number == other.serial_number &&
    ip_address == other.ip_address &&
    shape == other.shape &&
    lifecycle_state == other.lifecycle_state &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    is_marked_decom == other.is_marked_decom &&
    time_decom == other.time_decom
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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 224

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


204
205
206
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 213

def hash
  [id, compartment_id, mac_order_id, serial_number, ip_address, shape, lifecycle_state, time_created, time_updated, is_marked_decom, time_decom].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 257

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



251
252
253
# File 'lib/oci/mngdmac/models/mac_device_summary.rb', line 251

def to_s
  to_hash.to_s
end