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.



33724
33725
33726
33727
33728
33729
33730
33731
# File 'lib/ovirtsdk4/types.rb', line 33724

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.



33736
33737
33738
33739
33740
33741
33742
33743
# File 'lib/ovirtsdk4/types.rb', line 33736

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)


33526
33527
33528
# File 'lib/ovirtsdk4/types.rb', line 33526

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


33535
33536
33537
# File 'lib/ovirtsdk4/types.rb', line 33535

def comment=(value)
  @comment = value
end

#creation_dateDateTime

Returns the value of the creation_date attribute.

Returns:

  • (DateTime)


33544
33545
33546
# File 'lib/ovirtsdk4/types.rb', line 33544

def creation_date
  @creation_date
end

#creation_date=(value) ⇒ Object

Sets the value of the creation_date attribute.

Parameters:

  • value (DateTime)


33553
33554
33555
# File 'lib/ovirtsdk4/types.rb', line 33553

def creation_date=(value)
  @creation_date = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


33562
33563
33564
# File 'lib/ovirtsdk4/types.rb', line 33562

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


33571
33572
33573
# File 'lib/ovirtsdk4/types.rb', line 33571

def description=(value)
  @description = value
end

#disksArray<Disk>

Returns the value of the disks attribute.

Returns:



33580
33581
33582
# File 'lib/ovirtsdk4/types.rb', line 33580

def disks
  @disks
end

#disks=(list) ⇒ Object

Sets the value of the disks attribute.

Parameters:

  • list (Array<Disk>)


33589
33590
33591
33592
33593
33594
33595
33596
33597
33598
33599
# File 'lib/ovirtsdk4/types.rb', line 33589

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.



33748
33749
33750
33751
33752
33753
33754
33755
# File 'lib/ovirtsdk4/types.rb', line 33748

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)


33606
33607
33608
# File 'lib/ovirtsdk4/types.rb', line 33606

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


33615
33616
33617
# File 'lib/ovirtsdk4/types.rb', line 33615

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


33624
33625
33626
# File 'lib/ovirtsdk4/types.rb', line 33624

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


33633
33634
33635
# File 'lib/ovirtsdk4/types.rb', line 33633

def name=(value)
  @name = value
end

#parent_idString

Returns the value of the parent_id attribute.

Returns:

  • (String)


33642
33643
33644
# File 'lib/ovirtsdk4/types.rb', line 33642

def parent_id
  @parent_id
end

#parent_id=(value) ⇒ Object

Sets the value of the parent_id attribute.

Parameters:

  • value (String)


33651
33652
33653
# File 'lib/ovirtsdk4/types.rb', line 33651

def parent_id=(value)
  @parent_id = value
end

#stateCheckpointState

Returns the value of the state attribute.

Returns:



33660
33661
33662
# File 'lib/ovirtsdk4/types.rb', line 33660

def state
  @state
end

#state=(value) ⇒ Object

Sets the value of the state attribute.

Parameters:



33669
33670
33671
# File 'lib/ovirtsdk4/types.rb', line 33669

def state=(value)
  @state = value
end

#vmVm

Returns the value of the vm attribute.

Returns:



33678
33679
33680
# File 'lib/ovirtsdk4/types.rb', line 33678

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)


33691
33692
33693
33694
33695
33696
# File 'lib/ovirtsdk4/types.rb', line 33691

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