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.



43962
43963
43964
43965
43966
43967
43968
43969
43970
# File 'lib/ovirtsdk4/types.rb', line 43962

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.



43975
43976
43977
43978
43979
43980
43981
43982
43983
# File 'lib/ovirtsdk4/types.rb', line 43975

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)


43728
43729
43730
# File 'lib/ovirtsdk4/types.rb', line 43728

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


43737
43738
43739
# File 'lib/ovirtsdk4/types.rb', line 43737

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


43746
43747
43748
# File 'lib/ovirtsdk4/types.rb', line 43746

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


43755
43756
43757
# File 'lib/ovirtsdk4/types.rb', line 43755

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:



43764
43765
43766
# File 'lib/ovirtsdk4/types.rb', line 43764

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:



43777
43778
43779
43780
43781
43782
# File 'lib/ovirtsdk4/types.rb', line 43777

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)


43789
43790
43791
# File 'lib/ovirtsdk4/types.rb', line 43789

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)


43798
43799
43800
# File 'lib/ovirtsdk4/types.rb', line 43798

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.



43988
43989
43990
43991
43992
43993
43994
43995
43996
# File 'lib/ovirtsdk4/types.rb', line 43988

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)


43807
43808
43809
# File 'lib/ovirtsdk4/types.rb', line 43807

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


43816
43817
43818
# File 'lib/ovirtsdk4/types.rb', line 43816

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


43825
43826
43827
# File 'lib/ovirtsdk4/types.rb', line 43825

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


43834
43835
43836
# File 'lib/ovirtsdk4/types.rb', line 43834

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)


43843
43844
43845
# File 'lib/ovirtsdk4/types.rb', line 43843

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)


43852
43853
43854
# File 'lib/ovirtsdk4/types.rb', line 43852

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



43861
43862
43863
# File 'lib/ovirtsdk4/types.rb', line 43861

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



43870
43871
43872
43873
43874
43875
43876
43877
43878
43879
43880
# File 'lib/ovirtsdk4/types.rb', line 43870

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:



43887
43888
43889
# File 'lib/ovirtsdk4/types.rb', line 43887

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)


43896
43897
43898
43899
43900
43901
43902
43903
43904
43905
43906
# File 'lib/ovirtsdk4/types.rb', line 43896

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:



43913
43914
43915
# File 'lib/ovirtsdk4/types.rb', line 43913

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)


43922
43923
43924
43925
43926
43927
43928
43929
43930
43931
43932
# File 'lib/ovirtsdk4/types.rb', line 43922

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