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.


18342
18343
18344
18345
18346
18347
18348
18349
18350
# File 'lib/ovirtsdk4/types.rb', line 18342

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.


18355
18356
18357
18358
18359
18360
18361
18362
18363
# File 'lib/ovirtsdk4/types.rb', line 18355

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:


18107
18108
18109
# File 'lib/ovirtsdk4/types.rb', line 18107

def balances
  @balances
end

#balances=(list) ⇒ Object

Sets the value of the balances attribute.

Parameters:


18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
# File 'lib/ovirtsdk4/types.rb', line 18116

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)

18133
18134
18135
# File 'lib/ovirtsdk4/types.rb', line 18133

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

18142
18143
18144
# File 'lib/ovirtsdk4/types.rb', line 18142

def comment=(value)
  @comment = value
end

#default_policyBoolean

Returns the value of the default_policy attribute.

Returns:

  • (Boolean)

18151
18152
18153
# File 'lib/ovirtsdk4/types.rb', line 18151

def default_policy
  @default_policy
end

#default_policy=(value) ⇒ Object

Sets the value of the default_policy attribute.

Parameters:

  • value (Boolean)

18160
18161
18162
# File 'lib/ovirtsdk4/types.rb', line 18160

def default_policy=(value)
  @default_policy = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

18169
18170
18171
# File 'lib/ovirtsdk4/types.rb', line 18169

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

18178
18179
18180
# File 'lib/ovirtsdk4/types.rb', line 18178

def description=(value)
  @description = value
end

#filtersArray<Filter>

Returns the value of the filters attribute.

Returns:


18187
18188
18189
# File 'lib/ovirtsdk4/types.rb', line 18187

def filters
  @filters
end

#filters=(list) ⇒ Object

Sets the value of the filters attribute.

Parameters:


18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
# File 'lib/ovirtsdk4/types.rb', line 18196

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.


18368
18369
18370
18371
18372
18373
18374
18375
18376
# File 'lib/ovirtsdk4/types.rb', line 18368

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)

18213
18214
18215
# File 'lib/ovirtsdk4/types.rb', line 18213

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

18222
18223
18224
# File 'lib/ovirtsdk4/types.rb', line 18222

def id=(value)
  @id = value
end

#lockedBoolean

Returns the value of the locked attribute.

Returns:

  • (Boolean)

18231
18232
18233
# File 'lib/ovirtsdk4/types.rb', line 18231

def locked
  @locked
end

#locked=(value) ⇒ Object

Sets the value of the locked attribute.

Parameters:

  • value (Boolean)

18240
18241
18242
# File 'lib/ovirtsdk4/types.rb', line 18240

def locked=(value)
  @locked = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

18249
18250
18251
# File 'lib/ovirtsdk4/types.rb', line 18249

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

18258
18259
18260
# File 'lib/ovirtsdk4/types.rb', line 18258

def name=(value)
  @name = value
end

#propertiesArray<Property>

Returns the value of the properties attribute.

Returns:


18267
18268
18269
# File 'lib/ovirtsdk4/types.rb', line 18267

def properties
  @properties
end

#properties=(list) ⇒ Object

Sets the value of the properties attribute.

Parameters:


18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
# File 'lib/ovirtsdk4/types.rb', line 18276

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:


18293
18294
18295
# File 'lib/ovirtsdk4/types.rb', line 18293

def weight
  @weight
end

#weight=(list) ⇒ Object

Sets the value of the weight attribute.

Parameters:


18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
# File 'lib/ovirtsdk4/types.rb', line 18302

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