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.



40866
40867
40868
40869
40870
40871
40872
40873
40874
# File 'lib/ovirtsdk4/types.rb', line 40866

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.



40879
40880
40881
40882
40883
40884
40885
40886
40887
# File 'lib/ovirtsdk4/types.rb', line 40879

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)


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

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


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

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


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

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


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

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:



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

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:



40681
40682
40683
40684
40685
40686
# File 'lib/ovirtsdk4/types.rb', line 40681

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)


40693
40694
40695
# File 'lib/ovirtsdk4/types.rb', line 40693

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)


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

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.



40892
40893
40894
40895
40896
40897
40898
40899
40900
# File 'lib/ovirtsdk4/types.rb', line 40892

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)


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

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


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

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


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

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


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

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)


40747
40748
40749
# File 'lib/ovirtsdk4/types.rb', line 40747

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)


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

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:



40765
40766
40767
# File 'lib/ovirtsdk4/types.rb', line 40765

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:



40774
40775
40776
40777
40778
40779
40780
40781
40782
40783
40784
# File 'lib/ovirtsdk4/types.rb', line 40774

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:



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

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)


40800
40801
40802
40803
40804
40805
40806
40807
40808
40809
40810
# File 'lib/ovirtsdk4/types.rb', line 40800

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:



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

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)


40826
40827
40828
40829
40830
40831
40832
40833
40834
40835
40836
# File 'lib/ovirtsdk4/types.rb', line 40826

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