Class: Stripe::V2::Core::Health::AlertService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/v2/core/health/alert_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

Constructor Details

#initialize(requestor) ⇒ AlertService

Returns a new instance of AlertService.



11
12
13
14
# File 'lib/stripe/services/v2/core/health/alert_service.rb', line 11

def initialize(requestor)
  super
  @history = Stripe::V2::Core::Health::Alerts::HistoryService.new(@requestor)
end

Instance Attribute Details

#historyObject (readonly)

Returns the value of attribute history.



9
10
11
# File 'lib/stripe/services/v2/core/health/alert_service.rb', line 9

def history
  @history
end

Instance Method Details

#list(params = {}, opts = {}) ⇒ Object

Retrieves a list of health alerts.



17
18
19
20
21
22
23
24
25
# File 'lib/stripe/services/v2/core/health/alert_service.rb', line 17

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v2/core/health/alerts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(id, params = {}, opts = {}) ⇒ Object

Retrieves a health alert by ID.



28
29
30
31
32
33
34
35
36
# File 'lib/stripe/services/v2/core/health/alert_service.rb', line 28

def retrieve(id, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v2/core/health/alerts/%<id>s", { id: CGI.escape(id) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end