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.


42224
42225
42226
42227
42228
42229
42230
42231
42232
# File 'lib/ovirtsdk4/types.rb', line 42224

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.


42237
42238
42239
42240
42241
42242
42243
42244
42245
# File 'lib/ovirtsdk4/types.rb', line 42237

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)

41990
41991
41992
# File 'lib/ovirtsdk4/types.rb', line 41990

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

41999
42000
42001
# File 'lib/ovirtsdk4/types.rb', line 41999

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

42008
42009
42010
# File 'lib/ovirtsdk4/types.rb', line 42008

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

42017
42018
42019
# File 'lib/ovirtsdk4/types.rb', line 42017

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:


42026
42027
42028
# File 'lib/ovirtsdk4/types.rb', line 42026

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:


42039
42040
42041
42042
42043
42044
# File 'lib/ovirtsdk4/types.rb', line 42039

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)

42051
42052
42053
# File 'lib/ovirtsdk4/types.rb', line 42051

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)

42060
42061
42062
# File 'lib/ovirtsdk4/types.rb', line 42060

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.


42250
42251
42252
42253
42254
42255
42256
42257
42258
# File 'lib/ovirtsdk4/types.rb', line 42250

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)

42069
42070
42071
# File 'lib/ovirtsdk4/types.rb', line 42069

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

42078
42079
42080
# File 'lib/ovirtsdk4/types.rb', line 42078

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

42087
42088
42089
# File 'lib/ovirtsdk4/types.rb', line 42087

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

42096
42097
42098
# File 'lib/ovirtsdk4/types.rb', line 42096

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)

42105
42106
42107
# File 'lib/ovirtsdk4/types.rb', line 42105

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)

42114
42115
42116
# File 'lib/ovirtsdk4/types.rb', line 42114

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:


42123
42124
42125
# File 'lib/ovirtsdk4/types.rb', line 42123

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:


42132
42133
42134
42135
42136
42137
42138
42139
42140
42141
42142
# File 'lib/ovirtsdk4/types.rb', line 42132

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:


42149
42150
42151
# File 'lib/ovirtsdk4/types.rb', line 42149

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)

42158
42159
42160
42161
42162
42163
42164
42165
42166
42167
42168
# File 'lib/ovirtsdk4/types.rb', line 42158

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:


42175
42176
42177
# File 'lib/ovirtsdk4/types.rb', line 42175

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)

42184
42185
42186
42187
42188
42189
42190
42191
42192
42193
42194
# File 'lib/ovirtsdk4/types.rb', line 42184

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