Class: OvirtSDK4::ApiSummary

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

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


1250
1251
1252
1253
1254
1255
1256
# File 'lib/ovirtsdk4/types.rb', line 1250

def initialize(opts = {})
  super(opts)
  self.hosts = opts[:hosts]
  self.storage_domains = opts[:storage_domains]
  self.users = opts[:users]
  self.vms = opts[:vms]
end

Instance Method Details

#==(other) ⇒ Object

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


1261
1262
1263
1264
1265
1266
1267
# File 'lib/ovirtsdk4/types.rb', line 1261

def ==(other)
  super &&
  @hosts == other.hosts &&
  @storage_domains == other.storage_domains &&
  @users == other.users &&
  @vms == other.vms
end

#hashObject

Generates a hash value for this object.


1272
1273
1274
1275
1276
1277
1278
# File 'lib/ovirtsdk4/types.rb', line 1272

def hash
  super +
  @hosts.hash +
  @storage_domains.hash +
  @users.hash +
  @vms.hash
end

#hostsApiSummaryItem

Returns the value of the hosts attribute.

Returns:


1139
1140
1141
# File 'lib/ovirtsdk4/types.rb', line 1139

def hosts
  @hosts
end

#hosts=(value) ⇒ Object

Sets the value of the hosts attribute.

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


1152
1153
1154
1155
1156
1157
# File 'lib/ovirtsdk4/types.rb', line 1152

def hosts=(value)
  if value.is_a?(Hash)
    value = ApiSummaryItem.new(value)
  end
  @hosts = value
end

#storage_domainsApiSummaryItem

Returns the value of the storage_domains attribute.

Returns:


1164
1165
1166
# File 'lib/ovirtsdk4/types.rb', line 1164

def storage_domains
  @storage_domains
end

#storage_domains=(value) ⇒ Object

Sets the value of the storage_domains attribute.

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


1177
1178
1179
1180
1181
1182
# File 'lib/ovirtsdk4/types.rb', line 1177

def storage_domains=(value)
  if value.is_a?(Hash)
    value = ApiSummaryItem.new(value)
  end
  @storage_domains = value
end

#usersApiSummaryItem

Returns the value of the users attribute.

Returns:


1189
1190
1191
# File 'lib/ovirtsdk4/types.rb', line 1189

def users
  @users
end

#users=(value) ⇒ Object

Sets the value of the users attribute.

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


1202
1203
1204
1205
1206
1207
# File 'lib/ovirtsdk4/types.rb', line 1202

def users=(value)
  if value.is_a?(Hash)
    value = ApiSummaryItem.new(value)
  end
  @users = value
end

#vmsApiSummaryItem

Returns the value of the vms attribute.

Returns:


1214
1215
1216
# File 'lib/ovirtsdk4/types.rb', line 1214

def vms
  @vms
end

#vms=(value) ⇒ Object

Sets the value of the vms attribute.

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


1227
1228
1229
1230
1231
1232
# File 'lib/ovirtsdk4/types.rb', line 1227

def vms=(value)
  if value.is_a?(Hash)
    value = ApiSummaryItem.new(value)
  end
  @vms = value
end