Class: AdvancedBilling::ChargifyEBB
- Defined in:
- lib/advanced_billing/models/chargify_ebb.rb
Overview
ChargifyEBB Model.
Instance Attribute Summary collapse
-
#created_at ⇒ String
An ISO-8601 timestamp, set by Chargify at the time each event is recorded.
-
#id ⇒ String
A unique ID set by Chargify.
-
#subscription_id ⇒ Integer
Id of Maxio Advanced Billing Subscription which is connected to this event.
-
#subscription_reference ⇒ String
Reference of Maxio Advanced Billing Subscription which is connected to this event.
-
#timestamp ⇒ String
This timestamp determines what billing period the event will be billed in.
-
#uniqueness_token ⇒ String
User-defined string scoped per-stream.
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(timestamp = SKIP, id = SKIP, created_at = SKIP, uniqueness_token = SKIP, subscription_id = SKIP, subscription_reference = SKIP) ⇒ ChargifyEBB
constructor
A new instance of ChargifyEBB.
Methods inherited from BaseModel
Constructor Details
#initialize(timestamp = SKIP, id = SKIP, created_at = SKIP, uniqueness_token = SKIP, subscription_id = SKIP, subscription_reference = SKIP) ⇒ ChargifyEBB
Returns a new instance of ChargifyEBB.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 78 def initialize( = SKIP, id = SKIP, created_at = SKIP, uniqueness_token = SKIP, subscription_id = SKIP, subscription_reference = SKIP) @timestamp = unless == SKIP @id = id unless id == SKIP @created_at = created_at unless created_at == SKIP @uniqueness_token = uniqueness_token unless uniqueness_token == SKIP @subscription_id = subscription_id unless subscription_id == SKIP @subscription_reference = subscription_reference unless subscription_reference == SKIP end |
Instance Attribute Details
#created_at ⇒ String
An ISO-8601 timestamp, set by Chargify at the time each event is recorded. Please note that this field is reserved. If ‘chargify.created_at` is present in the request payload, it will be overwritten.
27 28 29 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 27 def created_at @created_at end |
#id ⇒ String
A unique ID set by Chargify. Please note that this field is reserved. If ‘chargify.id` is present in the request payload, it will be overwritten.
21 22 23 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 21 def id @id end |
#subscription_id ⇒ Integer
Id of Maxio Advanced Billing Subscription which is connected to this event. Provide ‘subscription_id` if you configured `chargify.subscription_id` as Subscription Identifier in your Event Stream.
39 40 41 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 39 def subscription_id @subscription_id end |
#subscription_reference ⇒ String
Reference of Maxio Advanced Billing Subscription which is connected to this event. Provide ‘subscription_reference` if you configured `chargify.subscription_reference` as Subscription Identifier in your Event Stream.
47 48 49 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 47 def subscription_reference @subscription_reference end |
#timestamp ⇒ String
This timestamp determines what billing period the event will be billed in. If your request payload does not include it, Chargify will add ‘chargify.timestamp` to the event payload and set the value to `now`.
16 17 18 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 16 def @timestamp end |
#uniqueness_token ⇒ String
User-defined string scoped per-stream. Duplicate events within a stream will be silently ignored. Tokens expire after 31 days.
32 33 34 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 32 def uniqueness_token @uniqueness_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 90 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. = hash.key?('timestamp') ? hash['timestamp'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP created_at = hash.key?('created_at') ? hash['created_at'] : SKIP uniqueness_token = hash.key?('uniqueness_token') ? hash['uniqueness_token'] : SKIP subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : SKIP subscription_reference = hash.key?('subscription_reference') ? hash['subscription_reference'] : SKIP # Create object from extracted values. ChargifyEBB.new(, id, created_at, uniqueness_token, subscription_id, subscription_reference) end |
.names ⇒ Object
A mapping from model property names to API property names.
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 50 def self.names @_hash = {} if @_hash.nil? @_hash['timestamp'] = 'timestamp' @_hash['id'] = 'id' @_hash['created_at'] = 'created_at' @_hash['uniqueness_token'] = 'uniqueness_token' @_hash['subscription_id'] = 'subscription_id' @_hash['subscription_reference'] = 'subscription_reference' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 74 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
62 63 64 65 66 67 68 69 70 71 |
# File 'lib/advanced_billing/models/chargify_ebb.rb', line 62 def self.optionals %w[ timestamp id created_at uniqueness_token subscription_id subscription_reference ] end |