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.



40935
40936
40937
40938
40939
40940
40941
40942
40943
# File 'lib/ovirtsdk4/types.rb', line 40935

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.



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

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)


40701
40702
40703
# File 'lib/ovirtsdk4/types.rb', line 40701

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


40710
40711
40712
# File 'lib/ovirtsdk4/types.rb', line 40710

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


40719
40720
40721
# File 'lib/ovirtsdk4/types.rb', line 40719

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


40728
40729
40730
# File 'lib/ovirtsdk4/types.rb', line 40728

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:



40737
40738
40739
# File 'lib/ovirtsdk4/types.rb', line 40737

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:



40750
40751
40752
40753
40754
40755
# File 'lib/ovirtsdk4/types.rb', line 40750

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)


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

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)


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

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.



40961
40962
40963
40964
40965
40966
40967
40968
40969
# File 'lib/ovirtsdk4/types.rb', line 40961

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)


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

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


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

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


40798
40799
40800
# File 'lib/ovirtsdk4/types.rb', line 40798

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


40807
40808
40809
# File 'lib/ovirtsdk4/types.rb', line 40807

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)


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

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)


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

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



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

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



40843
40844
40845
40846
40847
40848
40849
40850
40851
40852
40853
# File 'lib/ovirtsdk4/types.rb', line 40843

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:



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

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)


40869
40870
40871
40872
40873
40874
40875
40876
40877
40878
40879
# File 'lib/ovirtsdk4/types.rb', line 40869

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:



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

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)


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

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