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.



40806
40807
40808
40809
40810
40811
40812
40813
40814
# File 'lib/ovirtsdk4/types.rb', line 40806

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.



40819
40820
40821
40822
40823
40824
40825
40826
40827
# File 'lib/ovirtsdk4/types.rb', line 40819

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)


40572
40573
40574
# File 'lib/ovirtsdk4/types.rb', line 40572

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


40581
40582
40583
# File 'lib/ovirtsdk4/types.rb', line 40581

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


40590
40591
40592
# File 'lib/ovirtsdk4/types.rb', line 40590

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


40599
40600
40601
# File 'lib/ovirtsdk4/types.rb', line 40599

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:



40608
40609
40610
# File 'lib/ovirtsdk4/types.rb', line 40608

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:



40621
40622
40623
40624
40625
40626
# File 'lib/ovirtsdk4/types.rb', line 40621

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)


40633
40634
40635
# File 'lib/ovirtsdk4/types.rb', line 40633

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)


40642
40643
40644
# File 'lib/ovirtsdk4/types.rb', line 40642

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.



40832
40833
40834
40835
40836
40837
40838
40839
40840
# File 'lib/ovirtsdk4/types.rb', line 40832

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)


40651
40652
40653
# File 'lib/ovirtsdk4/types.rb', line 40651

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


40660
40661
40662
# File 'lib/ovirtsdk4/types.rb', line 40660

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


40669
40670
40671
# File 'lib/ovirtsdk4/types.rb', line 40669

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


40678
40679
40680
# File 'lib/ovirtsdk4/types.rb', line 40678

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)


40687
40688
40689
# File 'lib/ovirtsdk4/types.rb', line 40687

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)


40696
40697
40698
# File 'lib/ovirtsdk4/types.rb', line 40696

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



40705
40706
40707
# File 'lib/ovirtsdk4/types.rb', line 40705

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



40714
40715
40716
40717
40718
40719
40720
40721
40722
40723
40724
# File 'lib/ovirtsdk4/types.rb', line 40714

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:



40731
40732
40733
# File 'lib/ovirtsdk4/types.rb', line 40731

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)


40740
40741
40742
40743
40744
40745
40746
40747
40748
40749
40750
# File 'lib/ovirtsdk4/types.rb', line 40740

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:



40757
40758
40759
# File 'lib/ovirtsdk4/types.rb', line 40757

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)


40766
40767
40768
40769
40770
40771
40772
40773
40774
40775
40776
# File 'lib/ovirtsdk4/types.rb', line 40766

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