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.


43107
43108
43109
43110
43111
43112
43113
43114
43115
# File 'lib/ovirtsdk4/types.rb', line 43107

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.


43120
43121
43122
43123
43124
43125
43126
43127
43128
# File 'lib/ovirtsdk4/types.rb', line 43120

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)

42873
42874
42875
# File 'lib/ovirtsdk4/types.rb', line 42873

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

42882
42883
42884
# File 'lib/ovirtsdk4/types.rb', line 42882

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

42891
42892
42893
# File 'lib/ovirtsdk4/types.rb', line 42891

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

42900
42901
42902
# File 'lib/ovirtsdk4/types.rb', line 42900

def description=(value)
  @description = value
end

#domainDomain

Returns the value of the domain attribute.

Returns:


42909
42910
42911
# File 'lib/ovirtsdk4/types.rb', line 42909

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:


42922
42923
42924
42925
42926
42927
# File 'lib/ovirtsdk4/types.rb', line 42922

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)

42934
42935
42936
# File 'lib/ovirtsdk4/types.rb', line 42934

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)

42943
42944
42945
# File 'lib/ovirtsdk4/types.rb', line 42943

def domain_entry_id=(value)
  @domain_entry_id = value
end

#hashObject

Generates a hash value for this object.


43133
43134
43135
43136
43137
43138
43139
43140
43141
# File 'lib/ovirtsdk4/types.rb', line 43133

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)

42952
42953
42954
# File 'lib/ovirtsdk4/types.rb', line 42952

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

42961
42962
42963
# File 'lib/ovirtsdk4/types.rb', line 42961

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

42970
42971
42972
# File 'lib/ovirtsdk4/types.rb', line 42970

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

42979
42980
42981
# File 'lib/ovirtsdk4/types.rb', line 42979

def name=(value)
  @name = value
end

#namespaceString

Returns the value of the namespace attribute.

Returns:

  • (String)

42988
42989
42990
# File 'lib/ovirtsdk4/types.rb', line 42988

def namespace
  @namespace
end

#namespace=(value) ⇒ Object

Sets the value of the namespace attribute.

Parameters:

  • value (String)

42997
42998
42999
# File 'lib/ovirtsdk4/types.rb', line 42997

def namespace=(value)
  @namespace = value
end

#permissionsArray<Permission>

Returns the value of the permissions attribute.

Returns:


43006
43007
43008
# File 'lib/ovirtsdk4/types.rb', line 43006

def permissions
  @permissions
end

#permissions=(list) ⇒ Object

Sets the value of the permissions attribute.

Parameters:


43015
43016
43017
43018
43019
43020
43021
43022
43023
43024
43025
# File 'lib/ovirtsdk4/types.rb', line 43015

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:


43032
43033
43034
# File 'lib/ovirtsdk4/types.rb', line 43032

def roles
  @roles
end

#roles=(list) ⇒ Object

Sets the value of the roles attribute.

Parameters:

  • list (Array<Role>)

43041
43042
43043
43044
43045
43046
43047
43048
43049
43050
43051
# File 'lib/ovirtsdk4/types.rb', line 43041

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:


43058
43059
43060
# File 'lib/ovirtsdk4/types.rb', line 43058

def tags
  @tags
end

#tags=(list) ⇒ Object

Sets the value of the tags attribute.

Parameters:

  • list (Array<Tag>)

43067
43068
43069
43070
43071
43072
43073
43074
43075
43076
43077
# File 'lib/ovirtsdk4/types.rb', line 43067

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