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.

  • :vm (Vm, Hash)

    The value of attribute vm.


32648
32649
32650
32651
32652
32653
32654
# File 'lib/ovirtsdk4/types.rb', line 32648

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

Instance Method Details

#==(other) ⇒ Object

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


32659
32660
32661
32662
32663
32664
32665
# File 'lib/ovirtsdk4/types.rb', line 32659

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

32470
32471
32472
# File 'lib/ovirtsdk4/types.rb', line 32470

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

32479
32480
32481
# File 'lib/ovirtsdk4/types.rb', line 32479

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)

32488
32489
32490
# File 'lib/ovirtsdk4/types.rb', line 32488

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)

32497
32498
32499
# File 'lib/ovirtsdk4/types.rb', line 32497

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

32506
32507
32508
# File 'lib/ovirtsdk4/types.rb', line 32506

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

32515
32516
32517
# File 'lib/ovirtsdk4/types.rb', line 32515

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:


32524
32525
32526
# File 'lib/ovirtsdk4/types.rb', line 32524

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)

32533
32534
32535
32536
32537
32538
32539
32540
32541
32542
32543
# File 'lib/ovirtsdk4/types.rb', line 32533

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.


32670
32671
32672
32673
32674
32675
32676
# File 'lib/ovirtsdk4/types.rb', line 32670

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)

32550
32551
32552
# File 'lib/ovirtsdk4/types.rb', line 32550

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

32559
32560
32561
# File 'lib/ovirtsdk4/types.rb', line 32559

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

32568
32569
32570
# File 'lib/ovirtsdk4/types.rb', line 32568

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

32577
32578
32579
# File 'lib/ovirtsdk4/types.rb', line 32577

def name=(value)
  @name = value
end

#parent_idString

Returns the value of the parent_id attribute.

Returns:

  • (String)

32586
32587
32588
# File 'lib/ovirtsdk4/types.rb', line 32586

def parent_id
  @parent_id
end

#parent_id=(value) ⇒ Object

Sets the value of the parent_id attribute.

Parameters:

  • value (String)

32595
32596
32597
# File 'lib/ovirtsdk4/types.rb', line 32595

def parent_id=(value)
  @parent_id = value
end

#vmVm

Returns the value of the vm attribute.

Returns:


32604
32605
32606
# File 'lib/ovirtsdk4/types.rb', line 32604

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)

32617
32618
32619
32620
32621
32622
# File 'lib/ovirtsdk4/types.rb', line 32617

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