Class: OvirtSDK4::MigrationOptions

Inherits:
Struct
  • Object
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 = {}) ⇒ MigrationOptions

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



9462
9463
9464
9465
9466
9467
9468
# File 'lib/ovirtsdk4/types.rb', line 9462

def initialize(opts = {})
  super(opts)
  self.auto_converge = opts[:auto_converge]
  self.bandwidth = opts[:bandwidth]
  self.compressed = opts[:compressed]
  self.policy = opts[:policy]
end

Instance Method Details

#==(other) ⇒ Object

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



9473
9474
9475
9476
9477
9478
9479
# File 'lib/ovirtsdk4/types.rb', line 9473

def ==(other)
  super &&
  @auto_converge == other.auto_converge &&
  @bandwidth == other.bandwidth &&
  @compressed == other.compressed &&
  @policy == other.policy
end

#auto_convergeInheritableBoolean

Returns the value of the auto_converge attribute.

Returns:



9365
9366
9367
# File 'lib/ovirtsdk4/types.rb', line 9365

def auto_converge
  @auto_converge
end

#auto_converge=(value) ⇒ Object

Sets the value of the auto_converge attribute.

Parameters:



9374
9375
9376
# File 'lib/ovirtsdk4/types.rb', line 9374

def auto_converge=(value)
  @auto_converge = value
end

#bandwidthMigrationBandwidth

Returns the value of the bandwidth attribute.

Returns:



9383
9384
9385
# File 'lib/ovirtsdk4/types.rb', line 9383

def bandwidth
  @bandwidth
end

#bandwidth=(value) ⇒ Object

Sets the value of the bandwidth attribute.

The value parameter can be an instance of OvirtSDK4::MigrationBandwidth or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



9396
9397
9398
9399
9400
9401
# File 'lib/ovirtsdk4/types.rb', line 9396

def bandwidth=(value)
  if value.is_a?(Hash)
    value = MigrationBandwidth.new(value)
  end
  @bandwidth = value
end

#compressedInheritableBoolean

Returns the value of the compressed attribute.

Returns:



9408
9409
9410
# File 'lib/ovirtsdk4/types.rb', line 9408

def compressed
  @compressed
end

#compressed=(value) ⇒ Object

Sets the value of the compressed attribute.

Parameters:



9417
9418
9419
# File 'lib/ovirtsdk4/types.rb', line 9417

def compressed=(value)
  @compressed = value
end

#hashObject

Generates a hash value for this object.



9484
9485
9486
9487
9488
9489
9490
# File 'lib/ovirtsdk4/types.rb', line 9484

def hash
  super +
  @auto_converge.hash +
  @bandwidth.hash +
  @compressed.hash +
  @policy.hash
end

#policyMigrationPolicy

Returns the value of the policy attribute.

Returns:



9426
9427
9428
# File 'lib/ovirtsdk4/types.rb', line 9426

def policy
  @policy
end

#policy=(value) ⇒ Object

Sets the value of the policy attribute.

The value parameter can be an instance of OvirtSDK4::MigrationPolicy or a hash. If it is a hash then a new instance will be created passing the hash as the opts parameter to the constructor.

Parameters:



9439
9440
9441
9442
9443
9444
# File 'lib/ovirtsdk4/types.rb', line 9439

def policy=(value)
  if value.is_a?(Hash)
    value = MigrationPolicy.new(value)
  end
  @policy = value
end