Class: OvirtSDK4::VnicProfileMapping

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 = {}) ⇒ VnicProfileMapping

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

  • :source_network_name (String)

    The value of attribute source_network_name.

  • :source_network_profile_name (String)

    The value of attribute source_network_profile_name.

  • :target_vnic_profile (VnicProfile, Hash)

    The value of attribute target_vnic_profile.



26702
26703
26704
26705
26706
26707
# File 'lib/ovirtsdk4/types.rb', line 26702

def initialize(opts = {})
  super(opts)
  self.source_network_name = opts[:source_network_name]
  self.source_network_profile_name = opts[:source_network_profile_name]
  self.target_vnic_profile = opts[:target_vnic_profile]
end

Instance Method Details

#==(other) ⇒ Object

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



26712
26713
26714
26715
26716
26717
# File 'lib/ovirtsdk4/types.rb', line 26712

def ==(other)
  super &&
  @source_network_name == other.source_network_name &&
  @source_network_profile_name == other.source_network_profile_name &&
  @target_vnic_profile == other.target_vnic_profile
end

#hashObject

Generates a hash value for this object.



26722
26723
26724
26725
26726
26727
# File 'lib/ovirtsdk4/types.rb', line 26722

def hash
  super +
  @source_network_name.hash +
  @source_network_profile_name.hash +
  @target_vnic_profile.hash
end

#source_network_nameString

Returns the value of the source_network_name attribute.

Returns:

  • (String)


26632
26633
26634
# File 'lib/ovirtsdk4/types.rb', line 26632

def source_network_name
  @source_network_name
end

#source_network_name=(value) ⇒ Object

Sets the value of the source_network_name attribute.

Parameters:

  • value (String)


26641
26642
26643
# File 'lib/ovirtsdk4/types.rb', line 26641

def source_network_name=(value)
  @source_network_name = value
end

#source_network_profile_nameString

Returns the value of the source_network_profile_name attribute.

Returns:

  • (String)


26650
26651
26652
# File 'lib/ovirtsdk4/types.rb', line 26650

def source_network_profile_name
  @source_network_profile_name
end

#source_network_profile_name=(value) ⇒ Object

Sets the value of the source_network_profile_name attribute.

Parameters:

  • value (String)


26659
26660
26661
# File 'lib/ovirtsdk4/types.rb', line 26659

def source_network_profile_name=(value)
  @source_network_profile_name = value
end

#target_vnic_profileVnicProfile

Returns the value of the target_vnic_profile attribute.

Returns:



26668
26669
26670
# File 'lib/ovirtsdk4/types.rb', line 26668

def target_vnic_profile
  @target_vnic_profile
end

#target_vnic_profile=(value) ⇒ Object

Sets the value of the target_vnic_profile attribute.

The value parameter can be an instance of OvirtSDK4::VnicProfile 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:



26681
26682
26683
26684
26685
26686
# File 'lib/ovirtsdk4/types.rb', line 26681

def target_vnic_profile=(value)
  if value.is_a?(Hash)
    value = VnicProfile.new(value)
  end
  @target_vnic_profile = value
end