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


1256
1257
1258
1259
1260
1261
1262
# File 'lib/ovirtsdk4/types.rb', line 1256

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.


1267
1268
1269
1270
1271
1272
1273
# File 'lib/ovirtsdk4/types.rb', line 1267

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.


1278
1279
1280
1281
1282
1283
1284
# File 'lib/ovirtsdk4/types.rb', line 1278

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

#hostsApiSummaryItem

Returns the value of the hosts attribute.

Returns:


1145
1146
1147
# File 'lib/ovirtsdk4/types.rb', line 1145

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:


1158
1159
1160
1161
1162
1163
# File 'lib/ovirtsdk4/types.rb', line 1158

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:


1170
1171
1172
# File 'lib/ovirtsdk4/types.rb', line 1170

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:


1183
1184
1185
1186
1187
1188
# File 'lib/ovirtsdk4/types.rb', line 1183

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:


1195
1196
1197
# File 'lib/ovirtsdk4/types.rb', line 1195

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:


1208
1209
1210
1211
1212
1213
# File 'lib/ovirtsdk4/types.rb', line 1208

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:


1220
1221
1222
# File 'lib/ovirtsdk4/types.rb', line 1220

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:


1233
1234
1235
1236
1237
1238
# File 'lib/ovirtsdk4/types.rb', line 1233

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