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.



18448
18449
18450
18451
18452
18453
18454
18455
18456
# File 'lib/ovirtsdk4/types.rb', line 18448

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.



18461
18462
18463
18464
18465
18466
18467
18468
18469
# File 'lib/ovirtsdk4/types.rb', line 18461

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:



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

def balances
  @balances
end

#balances=(list) ⇒ Object

Sets the value of the balances attribute.

Parameters:



18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
# File 'lib/ovirtsdk4/types.rb', line 18222

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)


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

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


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

def comment=(value)
  @comment = value
end

#default_policyBoolean

Returns the value of the default_policy attribute.

Returns:

  • (Boolean)


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

def default_policy
  @default_policy
end

#default_policy=(value) ⇒ Object

Sets the value of the default_policy attribute.

Parameters:

  • value (Boolean)


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

def default_policy=(value)
  @default_policy = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


18275
18276
18277
# File 'lib/ovirtsdk4/types.rb', line 18275

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


18284
18285
18286
# File 'lib/ovirtsdk4/types.rb', line 18284

def description=(value)
  @description = value
end

#filtersArray<Filter>

Returns the value of the filters attribute.

Returns:



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

def filters
  @filters
end

#filters=(list) ⇒ Object

Sets the value of the filters attribute.

Parameters:



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

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.



18474
18475
18476
18477
18478
18479
18480
18481
18482
# File 'lib/ovirtsdk4/types.rb', line 18474

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)


18319
18320
18321
# File 'lib/ovirtsdk4/types.rb', line 18319

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


18328
18329
18330
# File 'lib/ovirtsdk4/types.rb', line 18328

def id=(value)
  @id = value
end

#lockedBoolean

Returns the value of the locked attribute.

Returns:

  • (Boolean)


18337
18338
18339
# File 'lib/ovirtsdk4/types.rb', line 18337

def locked
  @locked
end

#locked=(value) ⇒ Object

Sets the value of the locked attribute.

Parameters:

  • value (Boolean)


18346
18347
18348
# File 'lib/ovirtsdk4/types.rb', line 18346

def locked=(value)
  @locked = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


18355
18356
18357
# File 'lib/ovirtsdk4/types.rb', line 18355

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


18364
18365
18366
# File 'lib/ovirtsdk4/types.rb', line 18364

def name=(value)
  @name = value
end

#propertiesArray<Property>

Returns the value of the properties attribute.

Returns:



18373
18374
18375
# File 'lib/ovirtsdk4/types.rb', line 18373

def properties
  @properties
end

#properties=(list) ⇒ Object

Sets the value of the properties attribute.

Parameters:



18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
# File 'lib/ovirtsdk4/types.rb', line 18382

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:



18399
18400
18401
# File 'lib/ovirtsdk4/types.rb', line 18399

def weight
  @weight
end

#weight=(list) ⇒ Object

Sets the value of the weight attribute.

Parameters:



18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
# File 'lib/ovirtsdk4/types.rb', line 18408

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