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):


9587
9588
9589
9590
9591
9592
9593
9594
# File 'lib/ovirtsdk4/types.rb', line 9587

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

Instance Method Details

#==(other) ⇒ Object

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


9599
9600
9601
9602
9603
9604
9605
9606
# File 'lib/ovirtsdk4/types.rb', line 9599

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

#auto_convergeInheritableBoolean

Returns the value of the auto_converge attribute.

Returns:


9470
9471
9472
# File 'lib/ovirtsdk4/types.rb', line 9470

def auto_converge
  @auto_converge
end

#auto_converge=(value) ⇒ Object

Sets the value of the auto_converge attribute.

Parameters:


9479
9480
9481
# File 'lib/ovirtsdk4/types.rb', line 9479

def auto_converge=(value)
  @auto_converge = value
end

#bandwidthMigrationBandwidth

Returns the value of the bandwidth attribute.

Returns:


9488
9489
9490
# File 'lib/ovirtsdk4/types.rb', line 9488

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:


9501
9502
9503
9504
9505
9506
# File 'lib/ovirtsdk4/types.rb', line 9501

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:


9513
9514
9515
# File 'lib/ovirtsdk4/types.rb', line 9513

def compressed
  @compressed
end

#compressed=(value) ⇒ Object

Sets the value of the compressed attribute.

Parameters:


9522
9523
9524
# File 'lib/ovirtsdk4/types.rb', line 9522

def compressed=(value)
  @compressed = value
end

#encryptedInheritableBoolean

Returns the value of the encrypted attribute.

Returns:


9531
9532
9533
# File 'lib/ovirtsdk4/types.rb', line 9531

def encrypted
  @encrypted
end

#encrypted=(value) ⇒ Object

Sets the value of the encrypted attribute.

Parameters:


9540
9541
9542
# File 'lib/ovirtsdk4/types.rb', line 9540

def encrypted=(value)
  @encrypted = value
end

#hashObject

Generates a hash value for this object.


9611
9612
9613
9614
9615
9616
9617
9618
# File 'lib/ovirtsdk4/types.rb', line 9611

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

#policyMigrationPolicy

Returns the value of the policy attribute.

Returns:


9549
9550
9551
# File 'lib/ovirtsdk4/types.rb', line 9549

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:


9562
9563
9564
9565
9566
9567
# File 'lib/ovirtsdk4/types.rb', line 9562

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