class OvirtSDK4::SchedulingPolicy

Public Class Methods

new(opts = {}) click to toggle source

Creates a new instance of the {SchedulingPolicy} class.

@param opts [Hash] 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.

@option opts [Array<Balance>, Array<Hash>] :balances The values of attribute `balances`.

@option opts [String] :comment The value of attribute `comment`.

@option opts [Boolean] :default_policy The value of attribute `default_policy`.

@option opts [String] :description The value of attribute `description`.

@option opts [Array<Filter>, Array<Hash>] :filters The values of attribute `filters`.

@option opts [String] :id The value of attribute `id`.

@option opts [Boolean] :locked The value of attribute `locked`.

@option opts [String] :name The value of attribute `name`.

@option opts [Array<Property>, Array<Hash>] :properties The values of attribute `properties`.

@option opts [Array<Weight>, Array<Hash>] :weight The values of attribute `weight`.

Calls superclass method OvirtSDK4::Identified.new
# File lib/ovirtsdk4/types.rb, line 17919
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

Public Instance Methods

==(other) click to toggle source

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

Calls superclass method OvirtSDK4::Identified#==
# File lib/ovirtsdk4/types.rb, line 17932
def ==(other)
  super &&
  @balances == other.balances &&
  @default_policy == other.default_policy &&
  @filters == other.filters &&
  @locked == other.locked &&
  @properties == other.properties &&
  @weight == other.weight
end
balances() click to toggle source

Returns the value of the `balances` attribute.

@return [Array<Balance>]

# File lib/ovirtsdk4/types.rb, line 17684
def balances
  @balances
end
balances=(list) click to toggle source

Sets the value of the `balances` attribute.

@param list [Array<Balance>]

# File lib/ovirtsdk4/types.rb, line 17693
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
comment() click to toggle source

Returns the value of the `comment` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 17710
def comment
  @comment
end
comment=(value) click to toggle source

Sets the value of the `comment` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 17719
def comment=(value)
  @comment = value
end
default_policy() click to toggle source

Returns the value of the `default_policy` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 17728
def default_policy
  @default_policy
end
default_policy=(value) click to toggle source

Sets the value of the `default_policy` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 17737
def default_policy=(value)
  @default_policy = value
end
description() click to toggle source

Returns the value of the `description` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 17746
def description
  @description
end
description=(value) click to toggle source

Sets the value of the `description` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 17755
def description=(value)
  @description = value
end
filters() click to toggle source

Returns the value of the `filters` attribute.

@return [Array<Filter>]

# File lib/ovirtsdk4/types.rb, line 17764
def filters
  @filters
end
filters=(list) click to toggle source

Sets the value of the `filters` attribute.

@param list [Array<Filter>]

# File lib/ovirtsdk4/types.rb, line 17773
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
hash() click to toggle source

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Identified#hash
# File lib/ovirtsdk4/types.rb, line 17945
def hash
  super +
  @balances.hash +
  @default_policy.hash +
  @filters.hash +
  @locked.hash +
  @properties.hash +
  @weight.hash
end
id() click to toggle source

Returns the value of the `id` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 17790
def id
  @id
end
id=(value) click to toggle source

Sets the value of the `id` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 17799
def id=(value)
  @id = value
end
locked() click to toggle source

Returns the value of the `locked` attribute.

@return [Boolean]

# File lib/ovirtsdk4/types.rb, line 17808
def locked
  @locked
end
locked=(value) click to toggle source

Sets the value of the `locked` attribute.

@param value [Boolean]

# File lib/ovirtsdk4/types.rb, line 17817
def locked=(value)
  @locked = value
end
name() click to toggle source

Returns the value of the `name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 17826
def name
  @name
end
name=(value) click to toggle source

Sets the value of the `name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 17835
def name=(value)
  @name = value
end
properties() click to toggle source

Returns the value of the `properties` attribute.

@return [Array<Property>]

# File lib/ovirtsdk4/types.rb, line 17844
def properties
  @properties
end
properties=(list) click to toggle source

Sets the value of the `properties` attribute.

@param list [Array<Property>]

# File lib/ovirtsdk4/types.rb, line 17853
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
weight() click to toggle source

Returns the value of the `weight` attribute.

@return [Array<Weight>]

# File lib/ovirtsdk4/types.rb, line 17870
def weight
  @weight
end
weight=(list) click to toggle source

Sets the value of the `weight` attribute.

@param list [Array<Weight>]

# File lib/ovirtsdk4/types.rb, line 17879
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