Class: OvirtSDK4::SchedulingPolicy

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

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

  • :balances (Array<Balance>, Array<Hash>)

    The values of attribute balances.

  • :comment (String)

    The value of attribute comment.

  • :default_policy (Boolean)

    The value of attribute default_policy.

  • :description (String)

    The value of attribute description.

  • :filters (Array<Filter>, Array<Hash>)

    The values of attribute filters.

  • :id (String)

    The value of attribute id.

  • :locked (Boolean)

    The value of attribute locked.

  • :name (String)

    The value of attribute name.

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

    The values of attribute properties.

  • :weight (Array<Weight>, Array<Hash>)

    The values of attribute weight.



18043
18044
18045
18046
18047
18048
18049
18050
18051
# File 'lib/ovirtsdk4/types.rb', line 18043

def initialize(opts = {})
  super(opts)
  self.balances = opts[:balances]
  self.default_policy = opts[:default_policy]
  self.filters = opts[:filters]
  self.locked = opts[:locked]
  self.properties = opts[:properties]
  self.weight = opts[:weight]
end

Instance Method Details

#==(other) ⇒ Object

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



18056
18057
18058
18059
18060
18061
18062
18063
18064
# File 'lib/ovirtsdk4/types.rb', line 18056

def ==(other)
  super &&
  @balances == other.balances &&
  @default_policy == other.default_policy &&
  @filters == other.filters &&
  @locked == other.locked &&
  @properties == other.properties &&
  @weight == other.weight
end

#balancesArray<Balance>

Returns the value of the balances attribute.

Returns:



17808
17809
17810
# File 'lib/ovirtsdk4/types.rb', line 17808

def balances
  @balances
end

#balances=(list) ⇒ Object

Sets the value of the balances attribute.

Parameters:



17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
# File 'lib/ovirtsdk4/types.rb', line 17817

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


17834
17835
17836
# File 'lib/ovirtsdk4/types.rb', line 17834

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


17843
17844
17845
# File 'lib/ovirtsdk4/types.rb', line 17843

def comment=(value)
  @comment = value
end

#default_policyBoolean

Returns the value of the default_policy attribute.

Returns:

  • (Boolean)


17852
17853
17854
# File 'lib/ovirtsdk4/types.rb', line 17852

def default_policy
  @default_policy
end

#default_policy=(value) ⇒ Object

Sets the value of the default_policy attribute.

Parameters:

  • value (Boolean)


17861
17862
17863
# File 'lib/ovirtsdk4/types.rb', line 17861

def default_policy=(value)
  @default_policy = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


17870
17871
17872
# File 'lib/ovirtsdk4/types.rb', line 17870

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


17879
17880
17881
# File 'lib/ovirtsdk4/types.rb', line 17879

def description=(value)
  @description = value
end

#filtersArray<Filter>

Returns the value of the filters attribute.

Returns:



17888
17889
17890
# File 'lib/ovirtsdk4/types.rb', line 17888

def filters
  @filters
end

#filters=(list) ⇒ Object

Sets the value of the filters attribute.

Parameters:



17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
# File 'lib/ovirtsdk4/types.rb', line 17897

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

#hashObject

Generates a hash value for this object.



18069
18070
18071
18072
18073
18074
18075
18076
18077
# File 'lib/ovirtsdk4/types.rb', line 18069

def hash
  super +
  @balances.hash +
  @default_policy.hash +
  @filters.hash +
  @locked.hash +
  @properties.hash +
  @weight.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


17914
17915
17916
# File 'lib/ovirtsdk4/types.rb', line 17914

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


17923
17924
17925
# File 'lib/ovirtsdk4/types.rb', line 17923

def id=(value)
  @id = value
end

#lockedBoolean

Returns the value of the locked attribute.

Returns:

  • (Boolean)


17932
17933
17934
# File 'lib/ovirtsdk4/types.rb', line 17932

def locked
  @locked
end

#locked=(value) ⇒ Object

Sets the value of the locked attribute.

Parameters:

  • value (Boolean)


17941
17942
17943
# File 'lib/ovirtsdk4/types.rb', line 17941

def locked=(value)
  @locked = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


17950
17951
17952
# File 'lib/ovirtsdk4/types.rb', line 17950

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


17959
17960
17961
# File 'lib/ovirtsdk4/types.rb', line 17959

def name=(value)
  @name = value
end

#propertiesArray<Property>

Returns the value of the properties attribute.

Returns:



17968
17969
17970
# File 'lib/ovirtsdk4/types.rb', line 17968

def properties
  @properties
end

#properties=(list) ⇒ Object

Sets the value of the properties attribute.

Parameters:



17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
# File 'lib/ovirtsdk4/types.rb', line 17977

def properties=(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
  @properties = list
end

#weightArray<Weight>

Returns the value of the weight attribute.

Returns:



17994
17995
17996
# File 'lib/ovirtsdk4/types.rb', line 17994

def weight
  @weight
end

#weight=(list) ⇒ Object

Sets the value of the weight attribute.

Parameters:



18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
# File 'lib/ovirtsdk4/types.rb', line 18003

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