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
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 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/bf_ruby2/models/notification.rb', line 163 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“: }
63 64 65 |
# File 'lib/bf_ruby2/models/notification.rb', line 63 def ack_enabled @ack_enabled end |
#acked ⇒ Object
{ "description" : "The UTC DateTime when the notification was acked if it is ack enabled.", "verbs“: }
85 86 87 |
# File 'lib/bf_ruby2/models/notification.rb', line 85 def acked @acked end |
#action ⇒ Object
{ "description" : "The action associated with the notification.", "verbs“: }
45 46 47 |
# File 'lib/bf_ruby2/models/notification.rb', line 45 def action @action end |
#changed_by ⇒ Object
{ "description" : "ID of the user who last updated the entity.", "verbs":[] }
33 34 35 |
# File 'lib/bf_ruby2/models/notification.rb', line 33 def changed_by @changed_by end |
#changes ⇒ Object
Returns the value of attribute changes.
67 68 69 |
# File 'lib/bf_ruby2/models/notification.rb', line 67 def changes @changes end |
#created ⇒ Object
{ "description" : "The UTC DateTime when the object was created.", "verbs":[] }
30 31 32 |
# File 'lib/bf_ruby2/models/notification.rb', line 30 def created @created end |
#destination_url ⇒ Object
{ "description" : "The URL the notification will be sent to.", "verbs“: }
57 58 59 |
# File 'lib/bf_ruby2/models/notification.rb', line 57 def destination_url @destination_url end |
#domain ⇒ Object
{ "description" : "The domain of the notification.", "verbs“: }
42 43 44 |
# File 'lib/bf_ruby2/models/notification.rb', line 42 def domain @domain end |
#entity ⇒ Object
Returns the value of attribute entity.
65 66 67 |
# File 'lib/bf_ruby2/models/notification.rb', line 65 def entity @entity end |
#entity_id ⇒ Object
{ "description" : "The id of the entity associated with the notification.", "verbs“: }
54 55 56 |
# File 'lib/bf_ruby2/models/notification.rb', line 54 def entity_id @entity_id end |
#final_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notification’s final send attempt.", "verbs“: }
76 77 78 |
# File 'lib/bf_ruby2/models/notification.rb', line 76 def final_send_attempt @final_send_attempt end |
#format ⇒ Object
{ "description" : "Format of the notification.", "verbs“: }
60 61 62 |
# File 'lib/bf_ruby2/models/notification.rb', line 60 def format @format end |
#id ⇒ Object
{ "description" : "ID of the notification.", "verbs“: }
39 40 41 |
# File 'lib/bf_ruby2/models/notification.rb', line 39 def id @id end |
#last_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notifications’s last send attempt.", "verbs“: }
70 71 72 |
# File 'lib/bf_ruby2/models/notification.rb', line 70 def last_send_attempt @last_send_attempt end |
#next_send_attempt ⇒ Object
{ "description" : "The UTC DateTime of the notification’s next send attempt.", "verbs“: }
73 74 75 |
# File 'lib/bf_ruby2/models/notification.rb', line 73 def next_send_attempt @next_send_attempt end |
#organization_id ⇒ Object
{ "description" : "Organization associated with the notification.", "verbs“: }
48 49 50 |
# File 'lib/bf_ruby2/models/notification.rb', line 48 def organization_id @organization_id end |
#state ⇒ Object
{ "description" : "Whether the notification has been sent.", "verbs“: }
82 83 84 |
# File 'lib/bf_ruby2/models/notification.rb', line 82 def state @state end |
#total_send_attempts ⇒ Object
{ "description" : "The number of send attempts for this notification.", "verbs“: }
79 80 81 |
# File 'lib/bf_ruby2/models/notification.rb', line 79 def total_send_attempts @total_send_attempts end |
#updated ⇒ Object
{ "description" : "The UTC DateTime when the object was last updated.", "verbs":[] }
36 37 38 |
# File 'lib/bf_ruby2/models/notification.rb', line 36 def updated @updated end |
#webhook_id ⇒ Object
{ "description" : "Webhook associated with the notification.", "verbs“: }
51 52 53 |
# File 'lib/bf_ruby2/models/notification.rb', line 51 def webhook_id @webhook_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/bf_ruby2/models/notification.rb', line 110 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.
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/bf_ruby2/models/notification.rb', line 136 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.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/bf_ruby2/models/notification.rb', line 329 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
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/bf_ruby2/models/notification.rb', line 390 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 =~ /^(true|t|yes|y|1)$/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
456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/bf_ruby2/models/notification.rb', line 456 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
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/bf_ruby2/models/notification.rb', line 369 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/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
356 357 358 |
# File 'lib/bf_ruby2/models/notification.rb', line 356 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
362 363 364 |
# File 'lib/bf_ruby2/models/notification.rb', line 362 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?
259 260 261 262 |
# File 'lib/bf_ruby2/models/notification.rb', line 259 def list_invalid_properties invalid_properties = Array.new return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
436 437 438 |
# File 'lib/bf_ruby2/models/notification.rb', line 436 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
442 443 444 445 446 447 448 449 450 |
# File 'lib/bf_ruby2/models/notification.rb', line 442 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
430 431 432 |
# File 'lib/bf_ruby2/models/notification.rb', line 430 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/bf_ruby2/models/notification.rb', line 266 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 |