Class: BetterStack::Resources::StatusPage

Inherits:
Base
  • Object
show all
Defined in:
lib/betterstack/resources/status_page.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from BetterStack::Resources::Base

Instance Method Details

#add_resource(id, resource_attributes) ⇒ Object



44
45
46
# File 'lib/betterstack/resources/status_page.rb', line 44

def add_resource(id, resource_attributes)
  client.post("#{resource_path(id)}/resources", resource_attributes)
end

#add_section(id, section_attributes) ⇒ Object



28
29
30
# File 'lib/betterstack/resources/status_page.rb', line 28

def add_section(id, section_attributes)
  client.post("#{resource_path(id)}/sections", section_attributes)
end

#add_subscriber(id, subscriber_attributes) ⇒ Object



60
61
62
# File 'lib/betterstack/resources/status_page.rb', line 60

def add_subscriber(id, subscriber_attributes)
  client.post("#{resource_path(id)}/subscribers", subscriber_attributes)
end

#create(attributes) ⇒ Object



12
13
14
# File 'lib/betterstack/resources/status_page.rb', line 12

def create(attributes)
  client.post(resource_path, attributes)
end

#delete(id) ⇒ Object



20
21
22
# File 'lib/betterstack/resources/status_page.rb', line 20

def delete(id)
  client.delete(resource_path(id))
end

#get(id) ⇒ Object



8
9
10
# File 'lib/betterstack/resources/status_page.rb', line 8

def get(id)
  client.get(resource_path(id))
end

#list(params = {}) ⇒ Object



4
5
6
# File 'lib/betterstack/resources/status_page.rb', line 4

def list(params = {})
  client.get(resource_path, params)
end

#remove_resource(id, resource_id) ⇒ Object



52
53
54
# File 'lib/betterstack/resources/status_page.rb', line 52

def remove_resource(id, resource_id)
  client.delete("#{resource_path(id)}/resources/#{resource_id}")
end

#remove_section(id, section_id) ⇒ Object



36
37
38
# File 'lib/betterstack/resources/status_page.rb', line 36

def remove_section(id, section_id)
  client.delete("#{resource_path(id)}/sections/#{section_id}")
end

#remove_subscriber(id, subscriber_id) ⇒ Object



64
65
66
# File 'lib/betterstack/resources/status_page.rb', line 64

def remove_subscriber(id, subscriber_id)
  client.delete("#{resource_path(id)}/subscribers/#{subscriber_id}")
end

#resources(id, params = {}) ⇒ Object



40
41
42
# File 'lib/betterstack/resources/status_page.rb', line 40

def resources(id, params = {})
  client.get("#{resource_path(id)}/resources", params)
end

#sections(id, params = {}) ⇒ Object



24
25
26
# File 'lib/betterstack/resources/status_page.rb', line 24

def sections(id, params = {})
  client.get("#{resource_path(id)}/sections", params)
end

#subscribers(id, params = {}) ⇒ Object



56
57
58
# File 'lib/betterstack/resources/status_page.rb', line 56

def subscribers(id, params = {})
  client.get("#{resource_path(id)}/subscribers", params)
end

#update(id, attributes) ⇒ Object



16
17
18
# File 'lib/betterstack/resources/status_page.rb', line 16

def update(id, attributes)
  client.patch(resource_path(id), attributes)
end

#update_resource(id, resource_id, attributes) ⇒ Object



48
49
50
# File 'lib/betterstack/resources/status_page.rb', line 48

def update_resource(id, resource_id, attributes)
  client.patch("#{resource_path(id)}/resources/#{resource_id}", attributes)
end

#update_section(id, section_id, attributes) ⇒ Object



32
33
34
# File 'lib/betterstack/resources/status_page.rb', line 32

def update_section(id, section_id, attributes)
  client.patch("#{resource_path(id)}/sections/#{section_id}", attributes)
end