Class: OvirtSDK4::Group

Inherits:
Identified 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 = {}) ⇒ Group

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

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :domain (Domain, Hash)

    The value of attribute domain.

  • :domain_entry_id (String)

    The value of attribute domain_entry_id.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :namespace (String)

    The value of attribute namespace.

  • :permissions (Array<Permission>, Array<Hash>)

    The values of attribute permissions.

  • :roles (Array<Role>, Array<Hash>)

    The values of attribute roles.

  • :tags (Array<Tag>, Array<Hash>)

    The values of attribute tags.



44255
44256
44257
44258
44259
44260
44261
44262
44263
# File 'lib/ovirtsdk4/types.rb', line 44255

def initialize(opts = {})
  super(opts)
  self.domain = opts[:domain]
  self.domain_entry_id = opts[:domain_entry_id]
  self.namespace = opts[:namespace]
  self.permissions = opts[:permissions]
  self.roles = opts[:roles]
  self.tags = opts[:tags]
end

Instance Method Details

#==(other) ⇒ Object

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



44268
44269
44270
44271
44272
44273
44274
44275
44276
# File 'lib/ovirtsdk4/types.rb', line 44268

def ==(other)
  super &&
  @domain == other.domain &&
  @domain_entry_id == other.domain_entry_id &&
  @namespace == other.namespace &&
  @permissions == other.permissions &&
  @roles == other.roles &&
  @tags == other.tags
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


44021
44022
44023
# File 'lib/ovirtsdk4/types.rb', line 44021

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


44030
44031
44032
# File 'lib/ovirtsdk4/types.rb', line 44030

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


44039
44040
44041
# File 'lib/ovirtsdk4/types.rb', line 44039

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


44048
44049
44050
# File 'lib/ovirtsdk4/types.rb', line 44048

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:



44057
44058
44059
# File 'lib/ovirtsdk4/types.rb', line 44057

def domain
  @domain
end

#domain=(value) ⇒ Object

Sets the value of the domain attribute.

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



44070
44071
44072
44073
44074
44075
# File 'lib/ovirtsdk4/types.rb', line 44070

def domain=(value)
  if value.is_a?(Hash)
    value = Domain.new(value)
  end
  @domain = value
end

#domain_entry_idString

Returns the value of the domain_entry_id attribute.

Returns:

  • (String)


44082
44083
44084
# File 'lib/ovirtsdk4/types.rb', line 44082

def domain_entry_id
  @domain_entry_id
end

#domain_entry_id=(value) ⇒ Object

Sets the value of the domain_entry_id attribute.

Parameters:

  • value (String)


44091
44092
44093
# File 'lib/ovirtsdk4/types.rb', line 44091

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.



44281
44282
44283
44284
44285
44286
44287
44288
44289
# File 'lib/ovirtsdk4/types.rb', line 44281

def hash
  super +
  @domain.hash +
  @domain_entry_id.hash +
  @namespace.hash +
  @permissions.hash +
  @roles.hash +
  @tags.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


44100
44101
44102
# File 'lib/ovirtsdk4/types.rb', line 44100

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


44109
44110
44111
# File 'lib/ovirtsdk4/types.rb', line 44109

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


44118
44119
44120
# File 'lib/ovirtsdk4/types.rb', line 44118

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


44127
44128
44129
# File 'lib/ovirtsdk4/types.rb', line 44127

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)


44136
44137
44138
# File 'lib/ovirtsdk4/types.rb', line 44136

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)


44145
44146
44147
# File 'lib/ovirtsdk4/types.rb', line 44145

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



44154
44155
44156
# File 'lib/ovirtsdk4/types.rb', line 44154

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



44163
44164
44165
44166
44167
44168
44169
44170
44171
44172
44173
# File 'lib/ovirtsdk4/types.rb', line 44163

def permissions=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Permission.new(value)
      end
    end
  end
  @permissions = list
end

#rolesArray<Role>

Returns the value of the roles attribute.

Returns:



44180
44181
44182
# File 'lib/ovirtsdk4/types.rb', line 44180

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)


44189
44190
44191
44192
44193
44194
44195
44196
44197
44198
44199
# File 'lib/ovirtsdk4/types.rb', line 44189

def roles=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Role.new(value)
      end
    end
  end
  @roles = list
end

#tagsArray<Tag>

Returns the value of the tags attribute.

Returns:



44206
44207
44208
# File 'lib/ovirtsdk4/types.rb', line 44206

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)


44215
44216
44217
44218
44219
44220
44221
44222
44223
44224
44225
# File 'lib/ovirtsdk4/types.rb', line 44215

def tags=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Tag.new(value)
      end
    end
  end
  @tags = list
end