Class: OvirtSDK4::Domain

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 = {}) ⇒ Domain

Creates a new instance of the OvirtSDK4::Domain 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.

  • :groups (Array<Group>, Array<Hash>)

    The values of attribute groups.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :user (User, Hash)

    The value of attribute user.

  • :users (Array<User>, Array<Hash>)

    The values of attribute users.



36166
36167
36168
36169
36170
36171
# File 'lib/ovirtsdk4/types.rb', line 36166

def initialize(opts = {})
  super(opts)
  self.groups = opts[:groups]
  self.user = opts[:user]
  self.users = opts[:users]
end

Instance Method Details

#==(other) ⇒ Object

Returns true if self and other have the same attributes and values.



36176
36177
36178
36179
36180
36181
# File 'lib/ovirtsdk4/types.rb', line 36176

def ==(other)
  super &&
  @groups == other.groups &&
  @user == other.user &&
  @users == other.users
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


36000
36001
36002
# File 'lib/ovirtsdk4/types.rb', line 36000

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


36009
36010
36011
# File 'lib/ovirtsdk4/types.rb', line 36009

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


36018
36019
36020
# File 'lib/ovirtsdk4/types.rb', line 36018

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


36027
36028
36029
# File 'lib/ovirtsdk4/types.rb', line 36027

def description=(value)
  @description = value
end

#groupsArray<Group>

Returns the value of the groups attribute.

Returns:



36036
36037
36038
# File 'lib/ovirtsdk4/types.rb', line 36036

def groups
  @groups
end

#groups=(list) ⇒ Object

Sets the value of the groups attribute.

Parameters:



36045
36046
36047
36048
36049
36050
36051
36052
36053
36054
36055
# File 'lib/ovirtsdk4/types.rb', line 36045

def groups=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Group.new(value)
      end
    end
  end
  @groups = list
end

#hashObject

Generates a hash value for this object.



36186
36187
36188
36189
36190
36191
# File 'lib/ovirtsdk4/types.rb', line 36186

def hash
  super +
  @groups.hash +
  @user.hash +
  @users.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


36062
36063
36064
# File 'lib/ovirtsdk4/types.rb', line 36062

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


36071
36072
36073
# File 'lib/ovirtsdk4/types.rb', line 36071

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


36080
36081
36082
# File 'lib/ovirtsdk4/types.rb', line 36080

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


36089
36090
36091
# File 'lib/ovirtsdk4/types.rb', line 36089

def name=(value)
  @name = value
end

#userUser

Returns the value of the user attribute.

Returns:



36098
36099
36100
# File 'lib/ovirtsdk4/types.rb', line 36098

def user
  @user
end

#user=(value) ⇒ Object

Sets the value of the user attribute.

The value parameter can be an instance of User 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:

  • value (User, Hash)


36111
36112
36113
36114
36115
36116
# File 'lib/ovirtsdk4/types.rb', line 36111

def user=(value)
  if value.is_a?(Hash)
    value = User.new(value)
  end
  @user = value
end

#usersArray<User>

Returns the value of the users attribute.

Returns:



36123
36124
36125
# File 'lib/ovirtsdk4/types.rb', line 36123

def users
  @users
end

#users=(list) ⇒ Object

Sets the value of the users attribute.

Parameters:

  • list (Array<User>)


36132
36133
36134
36135
36136
36137
36138
36139
36140
36141
36142
# File 'lib/ovirtsdk4/types.rb', line 36132

def users=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = User.new(value)
      end
    end
  end
  @users = list
end