Class: OvirtSDK4::Checkpoint

Inherits:
Identified show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ Checkpoint

Creates a new instance of the OvirtSDK4::Checkpoint class.

Parameters:

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

    A hash containing the attributes of the object. The keys of the hash should be symbols corresponding to the names of the attributes. The values of the hash should be the values of the attributes.

Options Hash (opts):

  • :comment (String)

    The value of attribute comment.

  • :creation_date (DateTime)

    The value of attribute creation_date.

  • :description (String)

    The value of attribute description.

  • :disks (Array<Disk>, Array<Hash>)

    The values of attribute disks.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :parent_id (String)

    The value of attribute parent_id.

  • :state (CheckpointState)

    The value of attribute state.

  • :vm (Vm, Hash)

    The value of attribute vm.



33431
33432
33433
33434
33435
33436
33437
33438
# File 'lib/ovirtsdk4/types.rb', line 33431

def initialize(opts = {})
  super(opts)
  self.creation_date = opts[:creation_date]
  self.disks = opts[:disks]
  self.parent_id = opts[:parent_id]
  self.state = opts[:state]
  self.vm = opts[:vm]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



33443
33444
33445
33446
33447
33448
33449
33450
# File 'lib/ovirtsdk4/types.rb', line 33443

def ==(other)
  super &&
  @creation_date == other.creation_date &&
  @disks == other.disks &&
  @parent_id == other.parent_id &&
  @state == other.state &&
  @vm == other.vm
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


33233
33234
33235
# File 'lib/ovirtsdk4/types.rb', line 33233

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


33242
33243
33244
# File 'lib/ovirtsdk4/types.rb', line 33242

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)


33251
33252
33253
# File 'lib/ovirtsdk4/types.rb', line 33251

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)


33260
33261
33262
# File 'lib/ovirtsdk4/types.rb', line 33260

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


33269
33270
33271
# File 'lib/ovirtsdk4/types.rb', line 33269

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


33278
33279
33280
# File 'lib/ovirtsdk4/types.rb', line 33278

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



33287
33288
33289
# File 'lib/ovirtsdk4/types.rb', line 33287

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


33296
33297
33298
33299
33300
33301
33302
33303
33304
33305
33306
# File 'lib/ovirtsdk4/types.rb', line 33296

def disks=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Disk.new(value)
      end
    end
  end
  @disks = list
end

#hashObject

Generates a hash value for this object.



33455
33456
33457
33458
33459
33460
33461
33462
# File 'lib/ovirtsdk4/types.rb', line 33455

def hash
  super +
  @creation_date.hash +
  @disks.hash +
  @parent_id.hash +
  @state.hash +
  @vm.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


33313
33314
33315
# File 'lib/ovirtsdk4/types.rb', line 33313

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


33322
33323
33324
# File 'lib/ovirtsdk4/types.rb', line 33322

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


33331
33332
33333
# File 'lib/ovirtsdk4/types.rb', line 33331

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


33340
33341
33342
# File 'lib/ovirtsdk4/types.rb', line 33340

def name=(value)
  @name = value
end

#parent_idString

Returns the value of the parent_id attribute.

Returns:

  • (String)


33349
33350
33351
# File 'lib/ovirtsdk4/types.rb', line 33349

def parent_id
  @parent_id
end

#parent_id=(value) ⇒ Object

Sets the value of the parent_id attribute.

Parameters:

  • value (String)


33358
33359
33360
# File 'lib/ovirtsdk4/types.rb', line 33358

def parent_id=(value)
  @parent_id = value
end

#stateCheckpointState

Returns the value of the state attribute.

Returns:



33367
33368
33369
# File 'lib/ovirtsdk4/types.rb', line 33367

def state
  @state
end

#state=(value) ⇒ Object

Sets the value of the state attribute.

Parameters:



33376
33377
33378
# File 'lib/ovirtsdk4/types.rb', line 33376

def state=(value)
  @state = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



33385
33386
33387
# File 'lib/ovirtsdk4/types.rb', line 33385

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

The value parameter can be an instance of Vm or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:

  • value (Vm, Hash)


33398
33399
33400
33401
33402
33403
# File 'lib/ovirtsdk4/types.rb', line 33398

def vm=(value)
  if value.is_a?(Hash)
    value = Vm.new(value)
  end
  @vm = value
end