Class: OvirtSDK4::VmMediatedDevice

Inherits:
Device 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 = {}) ⇒ VmMediatedDevice

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

Options Hash (opts):

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :instance_type (InstanceType, Hash)

    The value of attribute instance_type.

  • :name (String)

    The value of attribute name.

  • :spec_params (Array<Property>, Array<Hash>)

    The values of attribute spec_params.

  • :template (Template, Hash)

    The value of attribute template.

  • :vm (Vm, Hash)

    The value of attribute vm.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.



53714
53715
53716
53717
# File 'lib/ovirtsdk4/types.rb', line 53714

def initialize(opts = {})
  super(opts)
  self.spec_params = opts[:spec_params]
end

Instance Method Details

#==(other) ⇒ Object

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



53722
53723
53724
53725
# File 'lib/ovirtsdk4/types.rb', line 53722

def ==(other)
  super &&
  @spec_params == other.spec_params
end

#commentString

Returns the value of the comment attribute.



53494
53495
53496
# File 'lib/ovirtsdk4/types.rb', line 53494

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



53503
53504
53505
# File 'lib/ovirtsdk4/types.rb', line 53503

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



53512
53513
53514
# File 'lib/ovirtsdk4/types.rb', line 53512

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



53521
53522
53523
# File 'lib/ovirtsdk4/types.rb', line 53521

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



53730
53731
53732
53733
# File 'lib/ovirtsdk4/types.rb', line 53730

def hash
  super +
  @spec_params.hash
end

#idString

Returns the value of the id attribute.



53530
53531
53532
# File 'lib/ovirtsdk4/types.rb', line 53530

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



53539
53540
53541
# File 'lib/ovirtsdk4/types.rb', line 53539

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.



53548
53549
53550
# File 'lib/ovirtsdk4/types.rb', line 53548

def instance_type
  @instance_type
end

#instance_type=(value) ⇒ Object

Sets the value of the instance_type attribute.

The value parameter can be an instance of InstanceType 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.



53561
53562
53563
53564
53565
53566
# File 'lib/ovirtsdk4/types.rb', line 53561

def instance_type=(value)
  if value.is_a?(Hash)
    value = InstanceType.new(value)
  end
  @instance_type = value
end

#nameString

Returns the value of the name attribute.



53573
53574
53575
# File 'lib/ovirtsdk4/types.rb', line 53573

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



53582
53583
53584
# File 'lib/ovirtsdk4/types.rb', line 53582

def name=(value)
  @name = value
end

#spec_paramsArray<Property>

Returns the value of the spec_params attribute.



53591
53592
53593
# File 'lib/ovirtsdk4/types.rb', line 53591

def spec_params
  @spec_params
end

#spec_params=(list) ⇒ Object

Sets the value of the spec_params attribute.



53600
53601
53602
53603
53604
53605
53606
53607
53608
53609
53610
# File 'lib/ovirtsdk4/types.rb', line 53600

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

#templateTemplate

Returns the value of the template attribute.



53617
53618
53619
# File 'lib/ovirtsdk4/types.rb', line 53617

def template
  @template
end

#template=(value) ⇒ Object

Sets the value of the template attribute.

The value parameter can be an instance of Template 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.



53630
53631
53632
53633
53634
53635
# File 'lib/ovirtsdk4/types.rb', line 53630

def template=(value)
  if value.is_a?(Hash)
    value = Template.new(value)
  end
  @template = value
end

#vmVm

Returns the value of the vm attribute.



53642
53643
53644
# File 'lib/ovirtsdk4/types.rb', line 53642

def vm
  @vm
end

#vm=(value) ⇒ Object

Sets the value of the vm attribute.

The value parameter can be an instance of OvirtSDK4::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.



53655
53656
53657
53658
53659
53660
# File 'lib/ovirtsdk4/types.rb', line 53655

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

#vmsArray<Vm>

Returns the value of the vms attribute.



53667
53668
53669
# File 'lib/ovirtsdk4/types.rb', line 53667

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.



53676
53677
53678
53679
53680
53681
53682
53683
53684
53685
53686
# File 'lib/ovirtsdk4/types.rb', line 53676

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