Class: Spage::Incident

Inherits:
Object
  • Object
show all
Defined in:
lib/spage/resources/incident.rb

Overview

Page resource in statuspage.io

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Incident

rubocop: disable Metrics/MethodLength, Metrics/AbcSize, Layout/LineLength



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/spage/resources/incident.rb', line 8

def initialize(attrs)
  @id                              = attrs['id']
  @components                      = attrs['components'] # Array of Component
  @impact                          = attrs['impact']
  @impact_override                 = attrs['impact_override']
  @incident_updates                = attrs['incident_updates'] # Array of IncidentUpdate
  @metadata                        = attrs['metadata'] # Hash of values
  @name                            = attrs['name']
  @page_id                         = attrs['page_id']
  @postmortem_body                 = attrs['postmortem_body']
  @postmortem_body_last_updated_at = attrs['postmortem_body_last_updated_at']
  @postmortem_ignored              = attrs['postmortem_ignored']
  @postmortem_notified_subscribers = attrs['postmortem_notified_subscribers']
  @postmortem_notified_twitter     = attrs['postmortem_notified_twitter']
  @postmortem_published_at         = attrs['postmortem_published_at']
  @scheduled_auto_completed        = attrs['scheduled_auto_completed']
  @scheduled_auto_in_progress      = attrs['scheduled_auto_in_progress']
  @scheduled_for                   = attrs['scheduled_for']
  @scheduled_remind_prior          = attrs['scheduled_remind_prior']
  @scheduled_reminded_at           = date_parse(attrs['scheduled_reminded_at'])
  @scheduled_until                 = attrs['scheduled_until']
  @shortlink                       = attrs['shortlink']
  @status                          = attrs['status']
  @monitoring_at                   = date_parse(attrs['monitoring_at'])
  @resolved_at                     = date_parse(attrs['resolved_at'])
  @created_at                      = date_parse(attrs['created_at'])
  @updated_at                      = date_parse(attrs['updated_at'])

  # vars only used to update/create incident
  @deliver_notifications                          = attrs['deliver_notifications']
  @auto_transition_deliver_notifications_at_end   = attrs['auto_transition_deliver_notifications_at_end']
  @auto_transition_deliver_notifications_at_start = attrs['auto_transition_deliver_notifications_at_start']
  @auto_transition_to_maintenance_state           = attrs['auto_transition_to_maintenance_state']
  @auto_transition_to_operational_state           = attrs['auto_transition_to_operational_state']
  @auto_tweet_at_beginning                        = attrs['auto_tweet_at_beginning']
  @auto_tweet_on_completion                       = attrs['auto_tweet_on_completion']
  @auto_tweet_on_creation                         = attrs['auto_tweet_on_creation']
  @auto_tweet_one_hour_before                     = attrs['auto_tweet_one_hour_before']
  @backfill_date                                  = attrs['backfill_date']
  @backfilled                                     = attrs['backfilled']
  @body                                           = attrs['body']
  @component_ids                                  = attrs['component_ids']
  @scheduled_auto_transition                      = attrs['scheduled_auto_transition']
end

Instance Attribute Details

#auto_transition_deliver_notifications_at_endObject

Returns the value of attribute auto_transition_deliver_notifications_at_end.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_transition_deliver_notifications_at_end
  @auto_transition_deliver_notifications_at_end
end

#auto_transition_deliver_notifications_at_startObject

Returns the value of attribute auto_transition_deliver_notifications_at_start.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_transition_deliver_notifications_at_start
  @auto_transition_deliver_notifications_at_start
end

#auto_transition_to_maintenance_stateObject

Returns the value of attribute auto_transition_to_maintenance_state.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_transition_to_maintenance_state
  @auto_transition_to_maintenance_state
end

#auto_transition_to_operational_stateObject

Returns the value of attribute auto_transition_to_operational_state.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_transition_to_operational_state
  @auto_transition_to_operational_state
end

#auto_tweet_at_beginningObject

Returns the value of attribute auto_tweet_at_beginning.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_tweet_at_beginning
  @auto_tweet_at_beginning
end

#auto_tweet_on_completionObject

Returns the value of attribute auto_tweet_on_completion.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_tweet_on_completion
  @auto_tweet_on_completion
end

#auto_tweet_on_creationObject

Returns the value of attribute auto_tweet_on_creation.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_tweet_on_creation
  @auto_tweet_on_creation
end

#auto_tweet_one_hour_beforeObject

Returns the value of attribute auto_tweet_one_hour_before.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def auto_tweet_one_hour_before
  @auto_tweet_one_hour_before
end

#backfill_dateObject

Returns the value of attribute backfill_date.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def backfill_date
  @backfill_date
end

#backfilledObject

Returns the value of attribute backfilled.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def backfilled
  @backfilled
end

#bodyObject

Returns the value of attribute body.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def body
  @body
end

#component_idsObject

Returns the value of attribute component_ids.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def component_ids
  @component_ids
end

#componentsObject

Returns the value of attribute components.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def components
  @components
end

#created_atObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def created_at
  @created_at
end

#deliver_notificationsObject

Returns the value of attribute deliver_notifications.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def deliver_notifications
  @deliver_notifications
end

#idObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def id
  @id
end

#impactObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def impact
  @impact
end

#impact_overrideObject

Returns the value of attribute impact_override.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def impact_override
  @impact_override
end

#incident_updatesObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def incident_updates
  @incident_updates
end

#metadataObject

Returns the value of attribute metadata.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def 
  @metadata
end

#monitoring_atObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def monitoring_at
  @monitoring_at
end

#nameObject

Returns the value of attribute name.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def name
  @name
end

#page_idObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def page_id
  @page_id
end

#postmortem_bodyObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def postmortem_body
  @postmortem_body
end

#postmortem_body_last_updated_atObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def postmortem_body_last_updated_at
  @postmortem_body_last_updated_at
end

#postmortem_ignoredObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def postmortem_ignored
  @postmortem_ignored
end

#postmortem_notified_subscribersObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def postmortem_notified_subscribers
  @postmortem_notified_subscribers
end

#postmortem_notified_twitterObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def postmortem_notified_twitter
  @postmortem_notified_twitter
end

#postmortem_published_atObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def postmortem_published_at
  @postmortem_published_at
end

#resolved_atObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def resolved_at
  @resolved_at
end

#scheduled_auto_completedObject

Returns the value of attribute scheduled_auto_completed.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def scheduled_auto_completed
  @scheduled_auto_completed
end

#scheduled_auto_in_progressObject

Returns the value of attribute scheduled_auto_in_progress.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def scheduled_auto_in_progress
  @scheduled_auto_in_progress
end

#scheduled_auto_transitionObject

Returns the value of attribute scheduled_auto_transition.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def scheduled_auto_transition
  @scheduled_auto_transition
end

#scheduled_forObject

Returns the value of attribute scheduled_for.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def scheduled_for
  @scheduled_for
end

#scheduled_remind_priorObject

Returns the value of attribute scheduled_remind_prior.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def scheduled_remind_prior
  @scheduled_remind_prior
end

#scheduled_untilObject

Returns the value of attribute scheduled_until.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def scheduled_until
  @scheduled_until
end

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def shortlink
  @shortlink
end

#statusObject

Returns the value of attribute status.



57
58
59
# File 'lib/spage/resources/incident.rb', line 57

def status
  @status
end

#updated_atObject (readonly)

rubocop: disable Layout/LineLength



55
56
57
# File 'lib/spage/resources/incident.rb', line 55

def updated_at
  @updated_at
end