Class: OvirtSDK4::Api

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

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

  • :authenticated_user (User, Hash)

    The value of attribute authenticated_user.

  • :effective_user (User, Hash)

    The value of attribute effective_user.

  • :product_info (ProductInfo, Hash)

    The value of attribute product_info.

  • :special_objects (SpecialObjects, Hash)

    The value of attribute special_objects.

  • :summary (ApiSummary, Hash)

    The value of attribute summary.

  • :time (DateTime)

    The value of attribute time.


1094
1095
1096
1097
1098
1099
1100
1101
1102
# File 'lib/ovirtsdk4/types.rb', line 1094

def initialize(opts = {})
  super(opts)
  self.authenticated_user = opts[:authenticated_user]
  self.effective_user = opts[:effective_user]
  self.product_info = opts[:product_info]
  self.special_objects = opts[:special_objects]
  self.summary = opts[:summary]
  self.time = opts[:time]
end

Instance Method Details

#==(other) ⇒ Object

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


1107
1108
1109
1110
1111
1112
1113
1114
1115
# File 'lib/ovirtsdk4/types.rb', line 1107

def ==(other)
  super &&
  @authenticated_user == other.authenticated_user &&
  @effective_user == other.effective_user &&
  @product_info == other.product_info &&
  @special_objects == other.special_objects &&
  @summary == other.summary &&
  @time == other.time
end

#authenticated_userUser

Returns the value of the authenticated_user attribute.

Returns:


936
937
938
# File 'lib/ovirtsdk4/types.rb', line 936

def authenticated_user
  @authenticated_user
end

#authenticated_user=(value) ⇒ Object

Sets the value of the authenticated_user attribute.

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

  • value (User, Hash)

949
950
951
952
953
954
# File 'lib/ovirtsdk4/types.rb', line 949

def authenticated_user=(value)
  if value.is_a?(Hash)
    value = User.new(value)
  end
  @authenticated_user = value
end

#effective_userUser

Returns the value of the effective_user attribute.

Returns:


961
962
963
# File 'lib/ovirtsdk4/types.rb', line 961

def effective_user
  @effective_user
end

#effective_user=(value) ⇒ Object

Sets the value of the effective_user attribute.

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

  • value (User, Hash)

974
975
976
977
978
979
# File 'lib/ovirtsdk4/types.rb', line 974

def effective_user=(value)
  if value.is_a?(Hash)
    value = User.new(value)
  end
  @effective_user = value
end

#hashObject

Generates a hash value for this object.


1120
1121
1122
1123
1124
1125
1126
1127
1128
# File 'lib/ovirtsdk4/types.rb', line 1120

def hash
  super +
  @authenticated_user.hash +
  @effective_user.hash +
  @product_info.hash +
  @special_objects.hash +
  @summary.hash +
  @time.hash
end

#product_infoProductInfo

Returns the value of the product_info attribute.

Returns:


986
987
988
# File 'lib/ovirtsdk4/types.rb', line 986

def product_info
  @product_info
end

#product_info=(value) ⇒ Object

Sets the value of the product_info attribute.

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


999
1000
1001
1002
1003
1004
# File 'lib/ovirtsdk4/types.rb', line 999

def product_info=(value)
  if value.is_a?(Hash)
    value = ProductInfo.new(value)
  end
  @product_info = value
end

#special_objectsSpecialObjects

Returns the value of the special_objects attribute.

Returns:


1011
1012
1013
# File 'lib/ovirtsdk4/types.rb', line 1011

def special_objects
  @special_objects
end

#special_objects=(value) ⇒ Object

Sets the value of the special_objects attribute.

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


1024
1025
1026
1027
1028
1029
# File 'lib/ovirtsdk4/types.rb', line 1024

def special_objects=(value)
  if value.is_a?(Hash)
    value = SpecialObjects.new(value)
  end
  @special_objects = value
end

#summaryApiSummary

Returns the value of the summary attribute.

Returns:


1036
1037
1038
# File 'lib/ovirtsdk4/types.rb', line 1036

def summary
  @summary
end

#summary=(value) ⇒ Object

Sets the value of the summary attribute.

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


1049
1050
1051
1052
1053
1054
# File 'lib/ovirtsdk4/types.rb', line 1049

def summary=(value)
  if value.is_a?(Hash)
    value = ApiSummary.new(value)
  end
  @summary = value
end

#timeDateTime

Returns the value of the time attribute.

Returns:

  • (DateTime)

1061
1062
1063
# File 'lib/ovirtsdk4/types.rb', line 1061

def time
  @time
end

#time=(value) ⇒ Object

Sets the value of the time attribute.

Parameters:

  • value (DateTime)

1070
1071
1072
# File 'lib/ovirtsdk4/types.rb', line 1070

def time=(value)
  @time = value
end