Class: Bfwd::Notification
- Inherits:
-
Object
- Object
- Bfwd::Notification
- Defined in:
- lib/bf_ruby2/models/notification.rb
Overview
Notification
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ack_enabled ⇒ Object
{ "description" : "If true notifications will continue to be sent until an acknowledgment is received.", "verbs“: }.
-
#acked ⇒ Object
{ "description" : "The UTC DateTime when the notification was acked if it is ack enabled.", "verbs“: }.
-
#action ⇒ Object
{ "description" : "The action associated with the notification.", "verbs“: }.
-
#changed_by ⇒ Object
{ "description" : "ID of the user who last updated the entity.", "verbs":[] }.
-
#changes ⇒ Object
Returns the value of attribute changes.
-
#created ⇒ Object
{ "description" : "The UTC DateTime when the object was created.", "verbs":[] }.
-
#destination_url ⇒ Object
{ "description" : "The URL the notification will be sent to.", "verbs“: }.
-
#domain ⇒ Object
{ "description" : "The domain of the notification.", "verbs“: }.
-
#entity ⇒ Object
Returns the value of attribute entity.
-
#entity_id ⇒ Object
{ "description" : "The id of the entity associated with the notification.", "verbs“: }.
-
#final_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notification’s final send attempt.", "verbs“: }.
-
#format ⇒ Object
{ "description" : "Format of the notification.", "verbs“: }.
-
#id ⇒ Object
{ "description" : "ID of the notification.", "verbs“: }.
-
#last_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notifications’s last send attempt.", "verbs“: }.
-
#next_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notification’s next send attempt.", "verbs“: }.
-
#organization_id ⇒ Object
{ "description" : "Organization associated with the notification.", "verbs“: }.
-
#state ⇒ Object
{ "description" : "Whether the notification has been sent.", "verbs“: }.
-
#total_send_attempts ⇒ Object
{ "description" : "The number of send attempts for this notification.", "verbs“: }.
-
#updated ⇒ Object
{ "description" : "The UTC DateTime when the object was last updated.", "verbs":[] }.
-
#webhook_id ⇒ Object
{ "description" : "Webhook associated with the notification.", "verbs“: }.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Notification
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Notification
Initializes the object
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/bf_ruby2/models/notification.rb', line 152 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'created') self.created = attributes[:'created'] end if attributes.has_key?(:'changedBy') self.changed_by = attributes[:'changedBy'] end if attributes.has_key?(:'updated') self.updated = attributes[:'updated'] end if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'domain') self.domain = attributes[:'domain'] end if attributes.has_key?(:'action') self.action = attributes[:'action'] end if attributes.has_key?(:'organizationID') self.organization_id = attributes[:'organizationID'] end if attributes.has_key?(:'webhookID') self.webhook_id = attributes[:'webhookID'] end if attributes.has_key?(:'entityID') self.entity_id = attributes[:'entityID'] end if attributes.has_key?(:'destinationURL') self.destination_url = attributes[:'destinationURL'] end if attributes.has_key?(:'format') self.format = attributes[:'format'] end if attributes.has_key?(:'ackEnabled') self.ack_enabled = attributes[:'ackEnabled'] else self.ack_enabled = false end if attributes.has_key?(:'entity') if (value = attributes[:'entity']).is_a?(Array) self.entity = value end end if attributes.has_key?(:'changes') if (value = attributes[:'changes']).is_a?(Array) self.changes = value end end if attributes.has_key?(:'lastSendAttempt') self.last_send_attempt = attributes[:'lastSendAttempt'] end if attributes.has_key?(:'nextSendAttempt') self.next_send_attempt = attributes[:'nextSendAttempt'] end if attributes.has_key?(:'finalSendAttempt') self.final_send_attempt = attributes[:'finalSendAttempt'] end if attributes.has_key?(:'totalSendAttempts') self.total_send_attempts = attributes[:'totalSendAttempts'] end if attributes.has_key?(:'state') self.state = attributes[:'state'] end if attributes.has_key?(:'acked') self.acked = attributes[:'acked'] end end |
Instance Attribute Details
#ack_enabled ⇒ Object
{ "description" : "If true notifications will continue to be sent until an acknowledgment is received.", "verbs“: }
52 53 54 |
# File 'lib/bf_ruby2/models/notification.rb', line 52 def ack_enabled @ack_enabled end |
#acked ⇒ Object
{ "description" : "The UTC DateTime when the notification was acked if it is ack enabled.", "verbs“: }
74 75 76 |
# File 'lib/bf_ruby2/models/notification.rb', line 74 def acked @acked end |
#action ⇒ Object
{ "description" : "The action associated with the notification.", "verbs“: }
34 35 36 |
# File 'lib/bf_ruby2/models/notification.rb', line 34 def action @action end |
#changed_by ⇒ Object
{ "description" : "ID of the user who last updated the entity.", "verbs":[] }
22 23 24 |
# File 'lib/bf_ruby2/models/notification.rb', line 22 def changed_by @changed_by end |
#changes ⇒ Object
Returns the value of attribute changes.
56 57 58 |
# File 'lib/bf_ruby2/models/notification.rb', line 56 def changes @changes end |
#created ⇒ Object
{ "description" : "The UTC DateTime when the object was created.", "verbs":[] }
19 20 21 |
# File 'lib/bf_ruby2/models/notification.rb', line 19 def created @created end |
#destination_url ⇒ Object
{ "description" : "The URL the notification will be sent to.", "verbs“: }
46 47 48 |
# File 'lib/bf_ruby2/models/notification.rb', line 46 def destination_url @destination_url end |
#domain ⇒ Object
{ "description" : "The domain of the notification.", "verbs“: }
31 32 33 |
# File 'lib/bf_ruby2/models/notification.rb', line 31 def domain @domain end |
#entity ⇒ Object
Returns the value of attribute entity.
54 55 56 |
# File 'lib/bf_ruby2/models/notification.rb', line 54 def entity @entity end |
#entity_id ⇒ Object
{ "description" : "The id of the entity associated with the notification.", "verbs“: }
43 44 45 |
# File 'lib/bf_ruby2/models/notification.rb', line 43 def entity_id @entity_id end |
#final_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notification’s final send attempt.", "verbs“: }
65 66 67 |
# File 'lib/bf_ruby2/models/notification.rb', line 65 def final_send_attempt @final_send_attempt end |
#format ⇒ Object
{ "description" : "Format of the notification.", "verbs“: }
49 50 51 |
# File 'lib/bf_ruby2/models/notification.rb', line 49 def format @format end |
#id ⇒ Object
{ "description" : "ID of the notification.", "verbs“: }
28 29 30 |
# File 'lib/bf_ruby2/models/notification.rb', line 28 def id @id end |
#last_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notifications’s last send attempt.", "verbs“: }
59 60 61 |
# File 'lib/bf_ruby2/models/notification.rb', line 59 def last_send_attempt @last_send_attempt end |
#next_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notification’s next send attempt.", "verbs“: }
62 63 64 |
# File 'lib/bf_ruby2/models/notification.rb', line 62 def next_send_attempt @next_send_attempt end |
#organization_id ⇒ Object
{ "description" : "Organization associated with the notification.", "verbs“: }
37 38 39 |
# File 'lib/bf_ruby2/models/notification.rb', line 37 def organization_id @organization_id end |
#state ⇒ Object
{ "description" : "Whether the notification has been sent.", "verbs“: }
71 72 73 |
# File 'lib/bf_ruby2/models/notification.rb', line 71 def state @state end |
#total_send_attempts ⇒ Object
{ "description" : "The number of send attempts for this notification.", "verbs“: }
68 69 70 |
# File 'lib/bf_ruby2/models/notification.rb', line 68 def total_send_attempts @total_send_attempts end |
#updated ⇒ Object
{ "description" : "The UTC DateTime when the object was last updated.", "verbs":[] }
25 26 27 |
# File 'lib/bf_ruby2/models/notification.rb', line 25 def updated @updated end |
#webhook_id ⇒ Object
{ "description" : "Webhook associated with the notification.", "verbs“: }
40 41 42 |
# File 'lib/bf_ruby2/models/notification.rb', line 40 def webhook_id @webhook_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/bf_ruby2/models/notification.rb', line 99 def self.attribute_map { :'created' => :'created', :'changed_by' => :'changedBy', :'updated' => :'updated', :'id' => :'id', :'domain' => :'domain', :'action' => :'action', :'organization_id' => :'organizationID', :'webhook_id' => :'webhookID', :'entity_id' => :'entityID', :'destination_url' => :'destinationURL', :'format' => :'format', :'ack_enabled' => :'ackEnabled', :'entity' => :'entity', :'changes' => :'changes', :'last_send_attempt' => :'lastSendAttempt', :'next_send_attempt' => :'nextSendAttempt', :'final_send_attempt' => :'finalSendAttempt', :'total_send_attempts' => :'totalSendAttempts', :'state' => :'state', :'acked' => :'acked' } end |
.swagger_types ⇒ Object
Attribute type mapping.
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/bf_ruby2/models/notification.rb', line 125 def self.swagger_types { :'created' => :'DateTime', :'changed_by' => :'String', :'updated' => :'DateTime', :'id' => :'String', :'domain' => :'String', :'action' => :'String', :'organization_id' => :'String', :'webhook_id' => :'String', :'entity_id' => :'String', :'destination_url' => :'String', :'format' => :'String', :'ack_enabled' => :'BOOLEAN', :'entity' => :'Array<String>', :'changes' => :'Array<String>', :'last_send_attempt' => :'DateTime', :'next_send_attempt' => :'DateTime', :'final_send_attempt' => :'DateTime', :'total_send_attempts' => :'Integer', :'state' => :'String', :'acked' => :'DateTime' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/bf_ruby2/models/notification.rb', line 354 def ==(o) return true if self.equal?(o) self.class == o.class && created == o.created && changed_by == o.changed_by && updated == o.updated && id == o.id && domain == o.domain && action == o.action && organization_id == o.organization_id && webhook_id == o.webhook_id && entity_id == o.entity_id && destination_url == o.destination_url && format == o.format && ack_enabled == o.ack_enabled && entity == o.entity && changes == o.changes && last_send_attempt == o.last_send_attempt && next_send_attempt == o.next_send_attempt && final_send_attempt == o.final_send_attempt && total_send_attempts == o.total_send_attempts && state == o.state && acked == o.acked end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/bf_ruby2/models/notification.rb', line 415 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = Bfwd.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
481 482 483 484 485 486 487 488 489 490 491 492 493 |
# File 'lib/bf_ruby2/models/notification.rb', line 481 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/bf_ruby2/models/notification.rb', line 394 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
381 382 383 |
# File 'lib/bf_ruby2/models/notification.rb', line 381 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
387 388 389 |
# File 'lib/bf_ruby2/models/notification.rb', line 387 def hash [created, changed_by, updated, id, domain, action, organization_id, webhook_id, entity_id, destination_url, format, ack_enabled, entity, changes, last_send_attempt, next_send_attempt, final_send_attempt, total_send_attempts, state, acked].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/bf_ruby2/models/notification.rb', line 248 def list_invalid_properties invalid_properties = Array.new if @domain.nil? invalid_properties.push("invalid value for 'domain', domain cannot be nil.") end if @action.nil? invalid_properties.push("invalid value for 'action', action cannot be nil.") end if @organization_id.nil? invalid_properties.push("invalid value for 'organization_id', organization_id cannot be nil.") end if @webhook_id.nil? invalid_properties.push("invalid value for 'webhook_id', webhook_id cannot be nil.") end if @entity_id.nil? invalid_properties.push("invalid value for 'entity_id', entity_id cannot be nil.") end if @destination_url.nil? invalid_properties.push("invalid value for 'destination_url', destination_url cannot be nil.") end if @format.nil? invalid_properties.push("invalid value for 'format', format cannot be nil.") end if @ack_enabled.nil? invalid_properties.push("invalid value for 'ack_enabled', ack_enabled cannot be nil.") end if @state.nil? invalid_properties.push("invalid value for 'state', state cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
461 462 463 |
# File 'lib/bf_ruby2/models/notification.rb', line 461 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
467 468 469 470 471 472 473 474 475 |
# File 'lib/bf_ruby2/models/notification.rb', line 467 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
455 456 457 |
# File 'lib/bf_ruby2/models/notification.rb', line 455 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/bf_ruby2/models/notification.rb', line 291 def valid? return false if @domain.nil? domain_validator = EnumAttributeValidator.new('String', ["Notification", "Organization", "OrganizationGateway", "Product", "User", "Subscription", "Profile", "ProductRatePlan", "Client", "Invoice", "PricingComponentValue", "Account", "PricingComponentValueChange", "PricingComponentTier", "PricingComponent", "PricingCalculation", "Coupon", "CouponDiscount", "CouponDefinition", "CouponInstance", "CouponModifier", "CouponRule", "CouponBookDefinition", "CouponBook", "InvoiceLine", "Webhook", "WebhookSubscription", "SubscriptionCancellation", "NotificationSnapshot", "InvoicePayment", "Payment", "PaymentMethod", "PaymentMethodSubscriptionLink", "DunningLine", "CybersourceToken", "Card", "Alias", "PaypalSimplePaymentReconciliation", "FreePaymentReconciliation", "LocustworldPaymentReconciliation", "CouponInstanceExistingValue", "TaxLine", "TaxationStrategy", "TaxationLink", "Address", "AmendmentPriceNTime", "Authority", "UnitOfMeasure", "SearchResult", "Amendment", "AuditLog", "Password", "Username", "FixedTermDefinition", "FixedTerm", "Refund", "CreditNote", "Receipt", "AmendmentCompoundConstituent", "APIConfiguration", "StripeToken", "BraintreeToken", "BalancedToken", "AuthorizeNetToken", "PaypalToken", "SpreedlyToken", "SagePayToken", "TrustCommerceToken", "PayVisionToken", "SagePayOutstandingTransaction", "SagePayEnabledCardType", "SagePayTransaction", "GatewayRevenue", "Migration", "AdhocSubscription", "SubscriptionCharge", "ComponentChange", "Verification", "UsageRoundingStrategies", "PricingComponentValueMigrationChargeAmendmentMapping", "AmendmentDiscardAmendment", "EntityTime", "AggregatingComponent", "PricingComponentMigrationValue", "MetadataKeyValue", "Metadata", "AggregationLink", "BFPermission", "Role", "PermissionLink", "PayVisionTransaction", "KashToken", "DataSynchronizationJob", "DataSynchronizationJobError", "DataSynchronizationConfiguration", "DataSynchronizationAppConfiguration", "AggregationChildrenResponse", "InvoiceLinePayment", "EmailSubscription", "EmailProvider", "TimeResponse", "Email", "RevenueAttribution", "Unknown"]) return false unless domain_validator.valid?(@domain) return false if @action.nil? action_validator = EnumAttributeValidator.new('String', ["Accept", "Active", "AwaitingPayment", "AwaitingRefund", "Cancelled", "Completed", "Created", "Error", "Expiring", "Expired", "Failed", "Migrated", "NeedsAmendments", "Paid", "Pending", "Provisioned", "Refunded", "Reject", "Trial", "Unknown", "Unpaid", "Updated", "Voided", "PaymentFailed"]) return false unless action_validator.valid?(@action) return false if @organization_id.nil? return false if @webhook_id.nil? return false if @entity_id.nil? return false if @destination_url.nil? return false if @format.nil? format_validator = EnumAttributeValidator.new('String', ["JSON", "XML"]) return false unless format_validator.valid?(@format) return false if @ack_enabled.nil? return false if @state.nil? state_validator = EnumAttributeValidator.new('String', ["Unsent", "Sending", "Sent"]) return false unless state_validator.valid?(@state) return true end |