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.

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.

  • :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.



53421
53422
53423
53424
# File 'lib/ovirtsdk4/types.rb', line 53421

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.



53429
53430
53431
53432
# File 'lib/ovirtsdk4/types.rb', line 53429

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


53201
53202
53203
# File 'lib/ovirtsdk4/types.rb', line 53201

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


53210
53211
53212
# File 'lib/ovirtsdk4/types.rb', line 53210

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


53219
53220
53221
# File 'lib/ovirtsdk4/types.rb', line 53219

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


53228
53229
53230
# File 'lib/ovirtsdk4/types.rb', line 53228

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



53437
53438
53439
53440
# File 'lib/ovirtsdk4/types.rb', line 53437

def hash
  super +
  @spec_params.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


53237
53238
53239
# File 'lib/ovirtsdk4/types.rb', line 53237

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


53246
53247
53248
# File 'lib/ovirtsdk4/types.rb', line 53246

def id=(value)
  @id = value
end

#instance_typeInstanceType

Returns the value of the instance_type attribute.

Returns:



53255
53256
53257
# File 'lib/ovirtsdk4/types.rb', line 53255

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.

Parameters:



53268
53269
53270
53271
53272
53273
# File 'lib/ovirtsdk4/types.rb', line 53268

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.

Returns:

  • (String)


53280
53281
53282
# File 'lib/ovirtsdk4/types.rb', line 53280

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


53289
53290
53291
# File 'lib/ovirtsdk4/types.rb', line 53289

def name=(value)
  @name = value
end

#spec_paramsArray<Property>

Returns the value of the spec_params attribute.

Returns:



53298
53299
53300
# File 'lib/ovirtsdk4/types.rb', line 53298

def spec_params
  @spec_params
end

#spec_params=(list) ⇒ Object

Sets the value of the spec_params attribute.

Parameters:



53307
53308
53309
53310
53311
53312
53313
53314
53315
53316
53317
# File 'lib/ovirtsdk4/types.rb', line 53307

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.

Returns:



53324
53325
53326
# File 'lib/ovirtsdk4/types.rb', line 53324

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.

Parameters:



53337
53338
53339
53340
53341
53342
# File 'lib/ovirtsdk4/types.rb', line 53337

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

#vmVm

Returns the value of the vm attribute.

Returns:



53349
53350
53351
# File 'lib/ovirtsdk4/types.rb', line 53349

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.

Parameters:

  • value (Vm, Hash)


53362
53363
53364
53365
53366
53367
# File 'lib/ovirtsdk4/types.rb', line 53362

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.

Returns:

  • (Array<Vm>)


53374
53375
53376
# File 'lib/ovirtsdk4/types.rb', line 53374

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


53383
53384
53385
53386
53387
53388
53389
53390
53391
53392
53393
# File 'lib/ovirtsdk4/types.rb', line 53383

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