Class: OvirtSDK4::DiskProfile

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 = {}) ⇒ DiskProfile

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

  • :name (String)

    The value of attribute name.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

  • :qos (Qos, Hash)

    The value of attribute qos.

  • :storage_domain (StorageDomain, Hash)

    The value of attribute storage_domain.



36851
36852
36853
36854
36855
36856
# File 'lib/ovirtsdk4/types.rb', line 36851

def initialize(opts = {})
  super(opts)
  self.permissions = opts[:permissions]
  self.qos = opts[:qos]
  self.storage_domain = opts[:storage_domain]
end

Instance Method Details

#==(other) ⇒ Object

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



36861
36862
36863
36864
36865
36866
# File 'lib/ovirtsdk4/types.rb', line 36861

def ==(other)
  super &&
  @permissions == other.permissions &&
  @qos == other.qos &&
  @storage_domain == other.storage_domain
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


36686
36687
36688
# File 'lib/ovirtsdk4/types.rb', line 36686

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


36695
36696
36697
# File 'lib/ovirtsdk4/types.rb', line 36695

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


36704
36705
36706
# File 'lib/ovirtsdk4/types.rb', line 36704

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


36713
36714
36715
# File 'lib/ovirtsdk4/types.rb', line 36713

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



36871
36872
36873
36874
36875
36876
# File 'lib/ovirtsdk4/types.rb', line 36871

def hash
  super +
  @permissions.hash +
  @qos.hash +
  @storage_domain.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


36722
36723
36724
# File 'lib/ovirtsdk4/types.rb', line 36722

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


36731
36732
36733
# File 'lib/ovirtsdk4/types.rb', line 36731

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


36740
36741
36742
# File 'lib/ovirtsdk4/types.rb', line 36740

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


36749
36750
36751
# File 'lib/ovirtsdk4/types.rb', line 36749

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



36758
36759
36760
# File 'lib/ovirtsdk4/types.rb', line 36758

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



36767
36768
36769
36770
36771
36772
36773
36774
36775
36776
36777
# File 'lib/ovirtsdk4/types.rb', line 36767

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

#qosQos

Returns the value of the qos attribute.

Returns:



36784
36785
36786
# File 'lib/ovirtsdk4/types.rb', line 36784

def qos
  @qos
end

#qos=(value) ⇒ Object

Sets the value of the qos attribute.

The value parameter can be an instance of Qos 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 (Qos, Hash)


36797
36798
36799
36800
36801
36802
# File 'lib/ovirtsdk4/types.rb', line 36797

def qos=(value)
  if value.is_a?(Hash)
    value = Qos.new(value)
  end
  @qos = value
end

#storage_domainStorageDomain

Returns the value of the storage_domain attribute.

Returns:



36809
36810
36811
# File 'lib/ovirtsdk4/types.rb', line 36809

def storage_domain
  @storage_domain
end

#storage_domain=(value) ⇒ Object

Sets the value of the storage_domain attribute.

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



36822
36823
36824
36825
36826
36827
# File 'lib/ovirtsdk4/types.rb', line 36822

def storage_domain=(value)
  if value.is_a?(Hash)
    value = StorageDomain.new(value)
  end
  @storage_domain = value
end