Class: OvirtSDK4::Payload

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary (collapse)

Methods included from Type

#href, #href=

Constructor Details

- (Payload) initialize(opts = {})

Creates a new instance of the OvirtSDK4::Payload 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):

  • :files (Array<File>, Array<Hash>)

    The values of attribute files.

  • :type (VmDeviceType)

    The value of attribute type.

  • :volume_id (String)

    The value of attribute volume_id.



9842
9843
9844
9845
9846
9847
# File 'lib/ovirtsdk4/types.rb', line 9842

def initialize(opts = {})
  super(opts)
  self.files = opts[:files]
  self.type = opts[:type]
  self.volume_id = opts[:volume_id]
end

Instance Method Details

- (Array<File>) files

Returns the value of the files attribute.

Returns:



9772
9773
9774
# File 'lib/ovirtsdk4/types.rb', line 9772

def files
  return @files
end

- (Object) files=(list)

Sets the value of the files attribute.

Parameters:

  • list (Array<File>)


9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
# File 'lib/ovirtsdk4/types.rb', line 9780

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

- (VmDeviceType) type

Returns the value of the type attribute.

Returns:



9797
9798
9799
# File 'lib/ovirtsdk4/types.rb', line 9797

def type
  return @type
end

- (Object) type=(value)

Sets the value of the type attribute.

Parameters:



9806
9807
9808
# File 'lib/ovirtsdk4/types.rb', line 9806

def type=(value)
  @type = value
end

- (String) volume_id

Returns the value of the volume_id attribute.

Returns:

  • (String)


9815
9816
9817
# File 'lib/ovirtsdk4/types.rb', line 9815

def volume_id
  return @volume_id
end

- (Object) volume_id=(value)

Sets the value of the volume_id attribute.

Parameters:

  • value (String)


9824
9825
9826
# File 'lib/ovirtsdk4/types.rb', line 9824

def volume_id=(value)
  @volume_id = value
end