Class: ThePlaidApi::FdxNotificationEntity
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::FdxNotificationEntity
- Defined in:
- lib/the_plaid_api/models/fdx_notification_entity.rb
Overview
Provides the base fields of a notification. Clients will read the ‘type` property to determine the expected notification payload
Instance Attribute Summary collapse
-
#category ⇒ NotificationCategory
Category of Notification.
-
#notification_id ⇒ String
Id of notification.
-
#notification_payload ⇒ NotificationPayloadEntity
Custom key-value pairs payload for a notification.
-
#priority ⇒ NotificationPriority
Priority of notification.
-
#publisher ⇒ PartyEntity
FDX Participant - an entity or person that is a part of a FDX API transaction.
-
#sent_on ⇒ DateTime
ISO 8601 date-time in format ‘YYYY-MM-DDThh:mm:ss.nnn[Z|hh:mm]’ according to [IETF RFC3339](xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#ancho r14).
-
#severity ⇒ NotificationSeverity
Severity level of notification.
-
#subscriber ⇒ PartyEntity
FDX Participant - an entity or person that is a part of a FDX API transaction.
-
#subtype ⇒ String
An optional initiator-defined event subtype code or description if the event type needs to be further categorized or described.
-
#type ⇒ NotificationType
Type of Notification.
-
#url ⇒ HateoasLink
REST application constraint (Hypermedia As The Engine Of Application State).
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(notification_id:, type:, sent_on:, category:, notification_payload:, subtype: SKIP, severity: SKIP, priority: SKIP, publisher: SKIP, subscriber: SKIP, url: SKIP, additional_properties: nil) ⇒ FdxNotificationEntity
constructor
A new instance of FdxNotificationEntity.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_sent_on ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(notification_id:, type:, sent_on:, category:, notification_payload:, subtype: SKIP, severity: SKIP, priority: SKIP, publisher: SKIP, subscriber: SKIP, url: SKIP, additional_properties: nil) ⇒ FdxNotificationEntity
Returns a new instance of FdxNotificationEntity.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 99 def initialize(notification_id:, type:, sent_on:, category:, notification_payload:, subtype: SKIP, severity: SKIP, priority: SKIP, publisher: SKIP, subscriber: SKIP, url: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @notification_id = notification_id @type = type @subtype = subtype unless subtype == SKIP @sent_on = sent_on @category = category @severity = severity unless severity == SKIP @priority = priority unless priority == SKIP @publisher = publisher unless publisher == SKIP @subscriber = subscriber unless subscriber == SKIP @notification_payload = notification_payload @url = url unless url == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#category ⇒ NotificationCategory
Category of Notification
36 37 38 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 36 def category @category end |
#notification_id ⇒ String
Id of notification
16 17 18 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 16 def notification_id @notification_id end |
#notification_payload ⇒ NotificationPayloadEntity
Custom key-value pairs payload for a notification
58 59 60 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 58 def notification_payload @notification_payload end |
#priority ⇒ NotificationPriority
Priority of notification
44 45 46 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 44 def priority @priority end |
#publisher ⇒ PartyEntity
FDX Participant - an entity or person that is a part of a FDX API transaction
49 50 51 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 49 def publisher @publisher end |
#sent_on ⇒ DateTime
ISO 8601 date-time in format ‘YYYY-MM-DDThh:mm:ss.nnn[Z|hh:mm]’ according to [IETF RFC3339](xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#ancho r14)
32 33 34 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 32 def sent_on @sent_on end |
#severity ⇒ NotificationSeverity
Severity level of notification
40 41 42 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 40 def severity @severity end |
#subscriber ⇒ PartyEntity
FDX Participant - an entity or person that is a part of a FDX API transaction
54 55 56 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 54 def subscriber @subscriber end |
#subtype ⇒ String
An optional initiator-defined event subtype code or description if the event type needs to be further categorized or described.
25 26 27 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 25 def subtype @subtype end |
#type ⇒ NotificationType
Type of Notification
20 21 22 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 20 def type @type end |
#url ⇒ HateoasLink
REST application constraint (Hypermedia As The Engine Of Application State)
63 64 65 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 63 def url @url end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 121 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. notification_id = hash.key?('notificationId') ? hash['notificationId'] : nil type = hash.key?('type') ? hash['type'] : nil sent_on = if hash.key?('sentOn') (DateTimeHelper.from_rfc3339(hash['sentOn']) if hash['sentOn']) end category = hash.key?('category') ? hash['category'] : nil notification_payload = NotificationPayloadEntity.from_hash(hash['notificationPayload']) if hash['notificationPayload'] subtype = hash.key?('subtype') ? hash['subtype'] : SKIP severity = hash.key?('severity') ? hash['severity'] : SKIP priority = hash.key?('priority') ? hash['priority'] : SKIP publisher = PartyEntity.from_hash(hash['publisher']) if hash['publisher'] subscriber = PartyEntity.from_hash(hash['subscriber']) if hash['subscriber'] url = HateoasLink.from_hash(hash['url']) if hash['url'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. FdxNotificationEntity.new(notification_id: notification_id, type: type, sent_on: sent_on, category: category, notification_payload: notification_payload, subtype: subtype, severity: severity, priority: priority, publisher: publisher, subscriber: subscriber, url: url, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 66 def self.names @_hash = {} if @_hash.nil? @_hash['notification_id'] = 'notificationId' @_hash['type'] = 'type' @_hash['subtype'] = 'subtype' @_hash['sent_on'] = 'sentOn' @_hash['category'] = 'category' @_hash['severity'] = 'severity' @_hash['priority'] = 'priority' @_hash['publisher'] = 'publisher' @_hash['subscriber'] = 'subscriber' @_hash['notification_payload'] = 'notificationPayload' @_hash['url'] = 'url' @_hash end |
.nullables ⇒ Object
An array for nullable fields
95 96 97 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 95 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 83 def self.optionals %w[ subtype severity priority publisher subscriber url ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
177 178 179 180 181 182 183 184 185 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 177 def inspect class_name = self.class.name.split('::').last "<#{class_name} notification_id: #{@notification_id.inspect}, type: #{@type.inspect},"\ " subtype: #{@subtype.inspect}, sent_on: #{@sent_on.inspect}, category:"\ " #{@category.inspect}, severity: #{@severity.inspect}, priority: #{@priority.inspect},"\ " publisher: #{@publisher.inspect}, subscriber: #{@subscriber.inspect},"\ " notification_payload: #{@notification_payload.inspect}, url: #{@url.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_sent_on ⇒ Object
163 164 165 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 163 def to_custom_sent_on DateTimeHelper.to_rfc3339(sent_on) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
168 169 170 171 172 173 174 |
# File 'lib/the_plaid_api/models/fdx_notification_entity.rb', line 168 def to_s class_name = self.class.name.split('::').last "<#{class_name} notification_id: #{@notification_id}, type: #{@type}, subtype: #{@subtype},"\ " sent_on: #{@sent_on}, category: #{@category}, severity: #{@severity}, priority:"\ " #{@priority}, publisher: #{@publisher}, subscriber: #{@subscriber}, notification_payload:"\ " #{@notification_payload}, url: #{@url}, additional_properties: #{@additional_properties}>" end |