Class: AdvancedBilling::SaleRepSubscription
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SaleRepSubscription
- Defined in:
- lib/advanced_billing/models/sale_rep_subscription.rb
Overview
SaleRepSubscription Model.
Instance Attribute Summary collapse
-
#churn_date ⇒ String
TODO: Write general description for this method.
-
#created_at ⇒ String
TODO: Write general description for this method.
-
#customer_name ⇒ String
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#last_payment ⇒ String
TODO: Write general description for this method.
-
#mrr ⇒ String
TODO: Write general description for this method.
-
#recurring ⇒ String
TODO: Write general description for this method.
-
#site_name ⇒ String
TODO: Write general description for this method.
-
#subscription_url ⇒ String
TODO: Write general description for this method.
-
#usage ⇒ String
TODO: Write general description for this method.
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(id: SKIP, site_name: SKIP, subscription_url: SKIP, customer_name: SKIP, created_at: SKIP, mrr: SKIP, usage: SKIP, recurring: SKIP, last_payment: SKIP, churn_date: SKIP, additional_properties: {}) ⇒ SaleRepSubscription
constructor
A new instance of SaleRepSubscription.
Methods inherited from BaseModel
Constructor Details
#initialize(id: SKIP, site_name: SKIP, subscription_url: SKIP, customer_name: SKIP, created_at: SKIP, mrr: SKIP, usage: SKIP, recurring: SKIP, last_payment: SKIP, churn_date: SKIP, additional_properties: {}) ⇒ SaleRepSubscription
Returns a new instance of SaleRepSubscription.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 91 def initialize(id: SKIP, site_name: SKIP, subscription_url: SKIP, customer_name: SKIP, created_at: SKIP, mrr: SKIP, usage: SKIP, recurring: SKIP, last_payment: SKIP, churn_date: SKIP, additional_properties: {}) @id = id unless id == SKIP @site_name = site_name unless site_name == SKIP @subscription_url = subscription_url unless subscription_url == SKIP @customer_name = customer_name unless customer_name == SKIP @created_at = created_at unless created_at == SKIP @mrr = mrr unless mrr == SKIP @usage = usage unless usage == SKIP @recurring = recurring unless recurring == SKIP @last_payment = last_payment unless last_payment == SKIP @churn_date = churn_date unless churn_date == SKIP # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#churn_date ⇒ String
TODO: Write general description for this method
50 51 52 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 50 def churn_date @churn_date end |
#created_at ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 30 def created_at @created_at end |
#customer_name ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 26 def customer_name @customer_name end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 14 def id @id end |
#last_payment ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 46 def last_payment @last_payment end |
#mrr ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 34 def mrr @mrr end |
#recurring ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 42 def recurring @recurring end |
#site_name ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 18 def site_name @site_name end |
#subscription_url ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 22 def subscription_url @subscription_url end |
#usage ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 38 def usage @usage end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 113 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP site_name = hash.key?('site_name') ? hash['site_name'] : SKIP subscription_url = hash.key?('subscription_url') ? hash['subscription_url'] : SKIP customer_name = hash.key?('customer_name') ? hash['customer_name'] : SKIP created_at = hash.key?('created_at') ? hash['created_at'] : SKIP mrr = hash.key?('mrr') ? hash['mrr'] : SKIP usage = hash.key?('usage') ? hash['usage'] : SKIP recurring = hash.key?('recurring') ? hash['recurring'] : SKIP last_payment = hash.key?('last_payment') ? hash['last_payment'] : SKIP churn_date = hash.key?('churn_date') ? hash['churn_date'] : SKIP # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. SaleRepSubscription.new(id: id, site_name: site_name, subscription_url: subscription_url, customer_name: customer_name, created_at: created_at, mrr: mrr, usage: usage, recurring: recurring, last_payment: last_payment, churn_date: churn_date, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['site_name'] = 'site_name' @_hash['subscription_url'] = 'subscription_url' @_hash['customer_name'] = 'customer_name' @_hash['created_at'] = 'created_at' @_hash['mrr'] = 'mrr' @_hash['usage'] = 'usage' @_hash['recurring'] = 'recurring' @_hash['last_payment'] = 'last_payment' @_hash['churn_date'] = 'churn_date' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 88 89 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 85 def self.nullables %w[ churn_date ] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/advanced_billing/models/sale_rep_subscription.rb', line 69 def self.optionals %w[ id site_name subscription_url customer_name created_at mrr usage recurring last_payment churn_date ] end |