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.



19191
19192
19193
19194
19195
19196
19197
19198
19199
# File 'lib/ovirtsdk4/types.rb', line 19191

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.



19204
19205
19206
19207
19208
19209
19210
19211
19212
# File 'lib/ovirtsdk4/types.rb', line 19204

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:



18956
18957
18958
# File 'lib/ovirtsdk4/types.rb', line 18956

def balances
  @balances
end

#balances=(list) ⇒ Object

Sets the value of the balances attribute.

Parameters:



18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
# File 'lib/ovirtsdk4/types.rb', line 18965

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)


18982
18983
18984
# File 'lib/ovirtsdk4/types.rb', line 18982

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


18991
18992
18993
# File 'lib/ovirtsdk4/types.rb', line 18991

def comment=(value)
  @comment = value
end

#default_policyBoolean

Returns the value of the default_policy attribute.

Returns:

  • (Boolean)


19000
19001
19002
# File 'lib/ovirtsdk4/types.rb', line 19000

def default_policy
  @default_policy
end

#default_policy=(value) ⇒ Object

Sets the value of the default_policy attribute.

Parameters:

  • value (Boolean)


19009
19010
19011
# File 'lib/ovirtsdk4/types.rb', line 19009

def default_policy=(value)
  @default_policy = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


19018
19019
19020
# File 'lib/ovirtsdk4/types.rb', line 19018

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


19027
19028
19029
# File 'lib/ovirtsdk4/types.rb', line 19027

def description=(value)
  @description = value
end

#filtersArray<Filter>

Returns the value of the filters attribute.

Returns:



19036
19037
19038
# File 'lib/ovirtsdk4/types.rb', line 19036

def filters
  @filters
end

#filters=(list) ⇒ Object

Sets the value of the filters attribute.

Parameters:



19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
# File 'lib/ovirtsdk4/types.rb', line 19045

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.



19217
19218
19219
19220
19221
19222
19223
19224
19225
# File 'lib/ovirtsdk4/types.rb', line 19217

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)


19062
19063
19064
# File 'lib/ovirtsdk4/types.rb', line 19062

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


19071
19072
19073
# File 'lib/ovirtsdk4/types.rb', line 19071

def id=(value)
  @id = value
end

#lockedBoolean

Returns the value of the locked attribute.

Returns:

  • (Boolean)


19080
19081
19082
# File 'lib/ovirtsdk4/types.rb', line 19080

def locked
  @locked
end

#locked=(value) ⇒ Object

Sets the value of the locked attribute.

Parameters:

  • value (Boolean)


19089
19090
19091
# File 'lib/ovirtsdk4/types.rb', line 19089

def locked=(value)
  @locked = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


19098
19099
19100
# File 'lib/ovirtsdk4/types.rb', line 19098

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


19107
19108
19109
# File 'lib/ovirtsdk4/types.rb', line 19107

def name=(value)
  @name = value
end

#propertiesArray<Property>

Returns the value of the properties attribute.

Returns:



19116
19117
19118
# File 'lib/ovirtsdk4/types.rb', line 19116

def properties
  @properties
end

#properties=(list) ⇒ Object

Sets the value of the properties attribute.

Parameters:



19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
# File 'lib/ovirtsdk4/types.rb', line 19125

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:



19142
19143
19144
# File 'lib/ovirtsdk4/types.rb', line 19142

def weight
  @weight
end

#weight=(list) ⇒ Object

Sets the value of the weight attribute.

Parameters:



19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
# File 'lib/ovirtsdk4/types.rb', line 19151

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