Class: GoCardlessPro::Resources::CustomerNotification
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::CustomerNotification
- Defined in:
- lib/gocardless_pro/resources/customer_notification.rb
Overview
Customer Notifications represent the notification which is due to be sent to a customer after an event has happened. The event, the resource and the customer to be notified are all identified in the ‘links` property.
Note that these are ephemeral records - once the notification has been actioned in some way, it is no longer visible using this API.
<p class=“restricted-notice”><strong>Restricted</strong>: This API is currently only available for approved integrators - please <a href=“[email protected]”>get in touch</a> if you would like to use this API.</p>
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#action_taken ⇒ Object
readonly
Returns the value of attribute action_taken.
-
#action_taken_at ⇒ Object
readonly
Returns the value of attribute action_taken_at.
-
#action_taken_by ⇒ Object
readonly
Returns the value of attribute action_taken_by.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ CustomerNotification
constructor
Initialize a customer_notification resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the customer_notification resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ CustomerNotification
Initialize a customer_notification resource instance
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 32 def initialize(object, response = nil) @object = object @action_taken = object['action_taken'] @action_taken_at = object['action_taken_at'] @action_taken_by = object['action_taken_by'] @id = object['id'] @links = object['links'] @type = object['type'] @response = response end |
Instance Attribute Details
#action_taken ⇒ Object (readonly)
Returns the value of attribute action_taken.
28 29 30 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 28 def action_taken @action_taken end |
#action_taken_at ⇒ Object (readonly)
Returns the value of attribute action_taken_at.
28 29 30 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 28 def action_taken_at @action_taken_at end |
#action_taken_by ⇒ Object (readonly)
Returns the value of attribute action_taken_by.
28 29 30 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 28 def action_taken_by @action_taken_by end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
28 29 30 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 28 def id @id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
28 29 30 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 28 def type @type end |
Instance Method Details
#api_response ⇒ Object
44 45 46 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 44 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
49 50 51 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 49 def links @customer_notification_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the customer_notification resource as a hash of all its readable attributes
54 55 56 |
# File 'lib/gocardless_pro/resources/customer_notification.rb', line 54 def to_h @object end |