Class: OvirtSDK4::Job

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

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

  • :auto_cleared (Boolean)

    The value of attribute auto_cleared.

  • :comment (String)

    The value of attribute comment.

  • :description (String)

    The value of attribute description.

  • :end_time (DateTime)

    The value of attribute end_time.

  • :external (Boolean)

    The value of attribute external.

  • :id (String)

    The value of attribute id.

  • :last_updated (DateTime)

    The value of attribute last_updated.

  • :name (String)

    The value of attribute name.

  • :owner (User, Hash)

    The value of attribute owner.

  • :start_time (DateTime)

    The value of attribute start_time.

  • :status (JobStatus)

    The value of attribute status.

  • :steps (Array<Step>, Array<Hash>)

    The values of attribute steps.



7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
# File 'lib/ovirtsdk4/types.rb', line 7456

def initialize(opts = {})
  super(opts)
  self.auto_cleared = opts[:auto_cleared]
  self.end_time = opts[:end_time]
  self.external = opts[:external]
  self.last_updated = opts[:last_updated]
  self.owner = opts[:owner]
  self.start_time = opts[:start_time]
  self.status = opts[:status]
  self.steps = opts[:steps]
end

Instance Method Details

#==(other) ⇒ Object

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



7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
# File 'lib/ovirtsdk4/types.rb', line 7471

def ==(other)
  super &&
  @auto_cleared == other.auto_cleared &&
  @end_time == other.end_time &&
  @external == other.external &&
  @last_updated == other.last_updated &&
  @owner == other.owner &&
  @start_time == other.start_time &&
  @status == other.status &&
  @steps == other.steps
end

#auto_clearedBoolean

Returns the value of the auto_cleared attribute.

Returns:

  • (Boolean)


7198
7199
7200
# File 'lib/ovirtsdk4/types.rb', line 7198

def auto_cleared
  @auto_cleared
end

#auto_cleared=(value) ⇒ Object

Sets the value of the auto_cleared attribute.

Parameters:

  • value (Boolean)


7207
7208
7209
# File 'lib/ovirtsdk4/types.rb', line 7207

def auto_cleared=(value)
  @auto_cleared = value
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


7216
7217
7218
# File 'lib/ovirtsdk4/types.rb', line 7216

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


7225
7226
7227
# File 'lib/ovirtsdk4/types.rb', line 7225

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


7234
7235
7236
# File 'lib/ovirtsdk4/types.rb', line 7234

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


7243
7244
7245
# File 'lib/ovirtsdk4/types.rb', line 7243

def description=(value)
  @description = value
end

#end_timeDateTime

Returns the value of the end_time attribute.

Returns:

  • (DateTime)


7252
7253
7254
# File 'lib/ovirtsdk4/types.rb', line 7252

def end_time
  @end_time
end

#end_time=(value) ⇒ Object

Sets the value of the end_time attribute.

Parameters:

  • value (DateTime)


7261
7262
7263
# File 'lib/ovirtsdk4/types.rb', line 7261

def end_time=(value)
  @end_time = value
end

#externalBoolean

Returns the value of the external attribute.

Returns:

  • (Boolean)


7270
7271
7272
# File 'lib/ovirtsdk4/types.rb', line 7270

def external
  @external
end

#external=(value) ⇒ Object

Sets the value of the external attribute.

Parameters:

  • value (Boolean)


7279
7280
7281
# File 'lib/ovirtsdk4/types.rb', line 7279

def external=(value)
  @external = value
end

#hashObject

Generates a hash value for this object.



7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
# File 'lib/ovirtsdk4/types.rb', line 7486

def hash
  super +
  @auto_cleared.hash +
  @end_time.hash +
  @external.hash +
  @last_updated.hash +
  @owner.hash +
  @start_time.hash +
  @status.hash +
  @steps.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


7288
7289
7290
# File 'lib/ovirtsdk4/types.rb', line 7288

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


7297
7298
7299
# File 'lib/ovirtsdk4/types.rb', line 7297

def id=(value)
  @id = value
end

#last_updatedDateTime

Returns the value of the last_updated attribute.

Returns:

  • (DateTime)


7306
7307
7308
# File 'lib/ovirtsdk4/types.rb', line 7306

def last_updated
  @last_updated
end

#last_updated=(value) ⇒ Object

Sets the value of the last_updated attribute.

Parameters:

  • value (DateTime)


7315
7316
7317
# File 'lib/ovirtsdk4/types.rb', line 7315

def last_updated=(value)
  @last_updated = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


7324
7325
7326
# File 'lib/ovirtsdk4/types.rb', line 7324

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


7333
7334
7335
# File 'lib/ovirtsdk4/types.rb', line 7333

def name=(value)
  @name = value
end

#ownerUser

Returns the value of the owner attribute.

Returns:



7342
7343
7344
# File 'lib/ovirtsdk4/types.rb', line 7342

def owner
  @owner
end

#owner=(value) ⇒ Object

Sets the value of the owner 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)


7355
7356
7357
7358
7359
7360
# File 'lib/ovirtsdk4/types.rb', line 7355

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

#start_timeDateTime

Returns the value of the start_time attribute.

Returns:

  • (DateTime)


7367
7368
7369
# File 'lib/ovirtsdk4/types.rb', line 7367

def start_time
  @start_time
end

#start_time=(value) ⇒ Object

Sets the value of the start_time attribute.

Parameters:

  • value (DateTime)


7376
7377
7378
# File 'lib/ovirtsdk4/types.rb', line 7376

def start_time=(value)
  @start_time = value
end

#statusJobStatus

Returns the value of the status attribute.

Returns:



7385
7386
7387
# File 'lib/ovirtsdk4/types.rb', line 7385

def status
  @status
end

#status=(value) ⇒ Object

Sets the value of the status attribute.

Parameters:



7394
7395
7396
# File 'lib/ovirtsdk4/types.rb', line 7394

def status=(value)
  @status = value
end

#stepsArray<Step>

Returns the value of the steps attribute.

Returns:



7403
7404
7405
# File 'lib/ovirtsdk4/types.rb', line 7403

def steps
  @steps
end

#steps=(list) ⇒ Object

Sets the value of the steps attribute.

Parameters:

  • list (Array<Step>)


7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
# File 'lib/ovirtsdk4/types.rb', line 7412

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