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.



40988
40989
40990
40991
40992
40993
40994
40995
40996
# File 'lib/ovirtsdk4/types.rb', line 40988

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.



41001
41002
41003
41004
41005
41006
41007
41008
41009
# File 'lib/ovirtsdk4/types.rb', line 41001

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)


40754
40755
40756
# File 'lib/ovirtsdk4/types.rb', line 40754

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


40763
40764
40765
# File 'lib/ovirtsdk4/types.rb', line 40763

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


40772
40773
40774
# File 'lib/ovirtsdk4/types.rb', line 40772

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


40781
40782
40783
# File 'lib/ovirtsdk4/types.rb', line 40781

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:



40790
40791
40792
# File 'lib/ovirtsdk4/types.rb', line 40790

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:



40803
40804
40805
40806
40807
40808
# File 'lib/ovirtsdk4/types.rb', line 40803

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)


40815
40816
40817
# File 'lib/ovirtsdk4/types.rb', line 40815

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)


40824
40825
40826
# File 'lib/ovirtsdk4/types.rb', line 40824

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.



41014
41015
41016
41017
41018
41019
41020
41021
41022
# File 'lib/ovirtsdk4/types.rb', line 41014

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)


40833
40834
40835
# File 'lib/ovirtsdk4/types.rb', line 40833

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


40842
40843
40844
# File 'lib/ovirtsdk4/types.rb', line 40842

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


40851
40852
40853
# File 'lib/ovirtsdk4/types.rb', line 40851

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


40860
40861
40862
# File 'lib/ovirtsdk4/types.rb', line 40860

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)


40869
40870
40871
# File 'lib/ovirtsdk4/types.rb', line 40869

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)


40878
40879
40880
# File 'lib/ovirtsdk4/types.rb', line 40878

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



40887
40888
40889
# File 'lib/ovirtsdk4/types.rb', line 40887

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



40896
40897
40898
40899
40900
40901
40902
40903
40904
40905
40906
# File 'lib/ovirtsdk4/types.rb', line 40896

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:



40913
40914
40915
# File 'lib/ovirtsdk4/types.rb', line 40913

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)


40922
40923
40924
40925
40926
40927
40928
40929
40930
40931
40932
# File 'lib/ovirtsdk4/types.rb', line 40922

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:



40939
40940
40941
# File 'lib/ovirtsdk4/types.rb', line 40939

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)


40948
40949
40950
40951
40952
40953
40954
40955
40956
40957
40958
# File 'lib/ovirtsdk4/types.rb', line 40948

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