Class: Stripe::Billing::AlertNotification

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/billing/alert_notification.rb

Constant Summary collapse

OBJECT_NAME =
"billing.alert_notification"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#actionObject (readonly)

Whether the alert was triggered or recovered.



13
14
15
# File 'lib/stripe/resources/billing/alert_notification.rb', line 13

def action
  @action
end

#aggregation_period_endObject (readonly)

End of the aggregation period for which this notification was sent. Only present for usage threshold alerts.



15
16
17
# File 'lib/stripe/resources/billing/alert_notification.rb', line 15

def aggregation_period_end
  @aggregation_period_end
end

#aggregation_period_startObject (readonly)

Start of the aggregation period for which this notification was sent. Only present for usage threshold alerts.



17
18
19
# File 'lib/stripe/resources/billing/alert_notification.rb', line 17

def aggregation_period_start
  @aggregation_period_start
end

#alertObject (readonly)

ID of the billing alert that generated this notification.



19
20
21
# File 'lib/stripe/resources/billing/alert_notification.rb', line 19

def alert
  @alert
end

#alert_typeObject (readonly)

The type of billing alert that generated this notification.



21
22
23
# File 'lib/stripe/resources/billing/alert_notification.rb', line 21

def alert_type
  @alert_type
end

#cadenceObject (readonly)

The billing cadence associated with this notification. Only present for spend threshold alerts grouped by billing cadence.



23
24
25
# File 'lib/stripe/resources/billing/alert_notification.rb', line 23

def cadence
  @cadence
end

#currencyObject (readonly)

Three-letter ISO currency code for the value, in lowercase. Only present for spend and credit balance threshold alerts.



25
26
27
# File 'lib/stripe/resources/billing/alert_notification.rb', line 25

def currency
  @currency
end

#custom_pricing_unitObject (readonly)

Custom pricing unit for the threshold value



27
28
29
# File 'lib/stripe/resources/billing/alert_notification.rb', line 27

def custom_pricing_unit
  @custom_pricing_unit
end

#customerObject (readonly)

ID of the customer for which the alert notification was sent.



29
30
31
# File 'lib/stripe/resources/billing/alert_notification.rb', line 29

def customer
  @customer
end

#idObject (readonly)

Unique identifier for the object.



31
32
33
# File 'lib/stripe/resources/billing/alert_notification.rb', line 31

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.



33
34
35
# File 'lib/stripe/resources/billing/alert_notification.rb', line 33

def livemode
  @livemode
end

#meterObject (readonly)

ID of the billing meter associated with this notification. Only present for usage threshold alerts.



35
36
37
# File 'lib/stripe/resources/billing/alert_notification.rb', line 35

def meter
  @meter
end

#notification_eventObject (readonly)

ID of the event delivered for this notification. Retrievable via the Events API for a limited time; for long-term audit scenarios, capture the full event payload at webhook delivery time.



37
38
39
# File 'lib/stripe/resources/billing/alert_notification.rb', line 37

def notification_event
  @notification_event
end

#notified_atObject (readonly)

Time at which the notification was sent. Measured in seconds since the Unix epoch.



39
40
41
# File 'lib/stripe/resources/billing/alert_notification.rb', line 39

def notified_at
  @notified_at
end

#objectObject (readonly)

String representing the object's type. Objects of the same type share the same value.



41
42
43
# File 'lib/stripe/resources/billing/alert_notification.rb', line 41

def object
  @object
end

#subscriptionObject (readonly)

ID of the subscription associated with this notification. Only present for spend threshold alerts grouped by subscription.



43
44
45
# File 'lib/stripe/resources/billing/alert_notification.rb', line 43

def subscription
  @subscription
end

#valueObject (readonly)

The value that triggered the alert. This may be a decimal string for custom pricing unit alerts. For usage threshold alerts, this is the meter event count. For credit balance and spend threshold alerts, this is the amount in the smallest currency unit.



45
46
47
# File 'lib/stripe/resources/billing/alert_notification.rb', line 45

def value
  @value
end

Class Method Details

.field_remappingsObject



51
52
53
# File 'lib/stripe/resources/billing/alert_notification.rb', line 51

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



47
48
49
# File 'lib/stripe/resources/billing/alert_notification.rb', line 47

def self.inner_class_types
  @inner_class_types = {}
end

.object_nameObject



8
9
10
# File 'lib/stripe/resources/billing/alert_notification.rb', line 8

def self.object_name
  "billing.alert_notification"
end