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.


36066
36067
36068
36069
36070
36071
# File 'lib/ovirtsdk4/types.rb', line 36066

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.


36076
36077
36078
36079
36080
36081
# File 'lib/ovirtsdk4/types.rb', line 36076

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)

35901
35902
35903
# File 'lib/ovirtsdk4/types.rb', line 35901

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

35910
35911
35912
# File 'lib/ovirtsdk4/types.rb', line 35910

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

35919
35920
35921
# File 'lib/ovirtsdk4/types.rb', line 35919

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

35928
35929
35930
# File 'lib/ovirtsdk4/types.rb', line 35928

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.


36086
36087
36088
36089
36090
36091
# File 'lib/ovirtsdk4/types.rb', line 36086

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)

35937
35938
35939
# File 'lib/ovirtsdk4/types.rb', line 35937

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

35946
35947
35948
# File 'lib/ovirtsdk4/types.rb', line 35946

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

35955
35956
35957
# File 'lib/ovirtsdk4/types.rb', line 35955

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

35964
35965
35966
# File 'lib/ovirtsdk4/types.rb', line 35964

def name=(value)
  @name = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:


35973
35974
35975
# File 'lib/ovirtsdk4/types.rb', line 35973

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:


35982
35983
35984
35985
35986
35987
35988
35989
35990
35991
35992
# File 'lib/ovirtsdk4/types.rb', line 35982

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:


35999
36000
36001
# File 'lib/ovirtsdk4/types.rb', line 35999

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)

36012
36013
36014
36015
36016
36017
# File 'lib/ovirtsdk4/types.rb', line 36012

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:


36024
36025
36026
# File 'lib/ovirtsdk4/types.rb', line 36024

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:


36037
36038
36039
36040
36041
36042
# File 'lib/ovirtsdk4/types.rb', line 36037

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