Class: Cadenya::Types::AgentScheduleInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(next_fire_at: nil, last_fire_at: nil, last_objective_id: nil, last_skipped_at: nil, last_skip_reason: nil, total_fires: nil, created_by: nil) ⇒ AgentScheduleInfo

Returns a new instance of AgentScheduleInfo.



471
472
473
474
475
476
477
478
479
# File 'lib/cadenya/types.rb', line 471

def initialize(next_fire_at: nil, last_fire_at: nil, last_objective_id: nil, last_skipped_at: nil, last_skip_reason: nil, total_fires: nil, created_by: nil)
  @next_fire_at = next_fire_at
  @last_fire_at = last_fire_at
  @last_objective_id = last_objective_id
  @last_skipped_at = last_skipped_at
  @last_skip_reason = last_skip_reason
  @total_fires = total_fires
  @created_by = created_by
end

Instance Attribute Details

#created_byObject (readonly)

Returns the value of attribute created_by.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def created_by
  @created_by
end

#last_fire_atObject (readonly)

Returns the value of attribute last_fire_at.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def last_fire_at
  @last_fire_at
end

#last_objective_idObject (readonly)

Returns the value of attribute last_objective_id.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def last_objective_id
  @last_objective_id
end

#last_skip_reasonObject (readonly)

Returns the value of attribute last_skip_reason.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def last_skip_reason
  @last_skip_reason
end

#last_skipped_atObject (readonly)

Returns the value of attribute last_skipped_at.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def last_skipped_at
  @last_skipped_at
end

#next_fire_atObject (readonly)

Returns the value of attribute next_fire_at.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def next_fire_at
  @next_fire_at
end

#total_firesObject (readonly)

Returns the value of attribute total_fires.



469
470
471
# File 'lib/cadenya/types.rb', line 469

def total_fires
  @total_fires
end

Class Method Details

.from_json(data) ⇒ Object



481
482
483
484
485
486
487
488
489
490
491
# File 'lib/cadenya/types.rb', line 481

def self.from_json(data)
  new(
    next_fire_at: data["nextFireAt"].nil? ? nil : Time.iso8601(data["nextFireAt"]),
    last_fire_at: data["lastFireAt"].nil? ? nil : Time.iso8601(data["lastFireAt"]),
    last_objective_id: data["lastObjectiveId"],
    last_skipped_at: data["lastSkippedAt"].nil? ? nil : Time.iso8601(data["lastSkippedAt"]),
    last_skip_reason: data["lastSkipReason"],
    total_fires: data["totalFires"],
    created_by: data["createdBy"].nil? ? nil : Types::Profile.from_json(data["createdBy"]),
  )
end

Instance Method Details

#to_hObject



493
494
495
496
497
498
499
500
501
502
503
# File 'lib/cadenya/types.rb', line 493

def to_h
  {
    next_fire_at: Util.plain(@next_fire_at),
    last_fire_at: Util.plain(@last_fire_at),
    last_objective_id: Util.plain(@last_objective_id),
    last_skipped_at: Util.plain(@last_skipped_at),
    last_skip_reason: Util.plain(@last_skip_reason),
    total_fires: Util.plain(@total_fires),
    created_by: Util.plain(@created_by),
  }.reject { |_k, v| v.nil? }
end