Class: AdvancedBilling::SubscriptionGroupInlined
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionGroupInlined
- Defined in:
- lib/advanced_billing/models/subscription_group_inlined.rb
Overview
SubscriptionGroupInlined Model.
Instance Attribute Summary collapse
-
#primary ⇒ TrueClass | FalseClass
A boolean indicating whether the subscription is the primary in the group.
-
#primary_subscription_id ⇒ String
The subscription ID of the primary within the group.
-
#scheme ⇒ String
Whether the group is configured to rely on a primary subscription for billing.
-
#uid ⇒ String
The UID for the group.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(uid = SKIP, scheme = SKIP, primary_subscription_id = SKIP, primary = SKIP) ⇒ SubscriptionGroupInlined
constructor
A new instance of SubscriptionGroupInlined.
Methods inherited from BaseModel
Constructor Details
#initialize(uid = SKIP, scheme = SKIP, primary_subscription_id = SKIP, primary = SKIP) ⇒ SubscriptionGroupInlined
Returns a new instance of SubscriptionGroupInlined.
56 57 58 59 60 61 62 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 56 def initialize(uid = SKIP, scheme = SKIP, primary_subscription_id = SKIP, primary = SKIP) @uid = uid unless uid == SKIP @scheme = scheme unless scheme == SKIP @primary_subscription_id = primary_subscription_id unless primary_subscription_id == SKIP @primary = primary unless primary == SKIP end |
Instance Attribute Details
#primary ⇒ TrueClass | FalseClass
A boolean indicating whether the subscription is the primary in the group. Applicable to scheme 1.
29 30 31 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 29 def primary @primary end |
#primary_subscription_id ⇒ String
The subscription ID of the primary within the group. Applicable to scheme 1.
24 25 26 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 24 def primary_subscription_id @primary_subscription_id end |
#scheme ⇒ String
Whether the group is configured to rely on a primary subscription for billing. At this time, it will always be 1.
19 20 21 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 19 def scheme @scheme end |
#uid ⇒ String
The UID for the group
14 15 16 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 14 def uid @uid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. uid = hash.key?('uid') ? hash['uid'] : SKIP scheme = hash.key?('scheme') ? hash['scheme'] : SKIP primary_subscription_id = hash.key?('primary_subscription_id') ? hash['primary_subscription_id'] : SKIP primary = hash.key?('primary') ? hash['primary'] : SKIP # Create object from extracted values. SubscriptionGroupInlined.new(uid, scheme, primary_subscription_id, primary) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['uid'] = 'uid' @_hash['scheme'] = 'scheme' @_hash['primary_subscription_id'] = 'primary_subscription_id' @_hash['primary'] = 'primary' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
42 43 44 45 46 47 48 49 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 42 def self.optionals %w[ uid scheme primary_subscription_id primary ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
84 85 86 87 88 89 90 |
# File 'lib/advanced_billing/models/subscription_group_inlined.rb', line 84 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |