Class: AdvancedBilling::CreateSubscriptionGroup
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::CreateSubscriptionGroup
- Defined in:
- lib/advanced_billing/models/create_subscription_group.rb
Overview
CreateSubscriptionGroup Model.
Instance Attribute Summary collapse
-
#member_ids ⇒ Array[Integer]
TODO: Write general description for this method.
-
#subscription_id ⇒ Integer
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(subscription_id:, member_ids: SKIP, additional_properties: {}) ⇒ CreateSubscriptionGroup
constructor
A new instance of CreateSubscriptionGroup.
Methods inherited from BaseModel
Constructor Details
#initialize(subscription_id:, member_ids: SKIP, additional_properties: {}) ⇒ CreateSubscriptionGroup
Returns a new instance of CreateSubscriptionGroup.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 40 def initialize(subscription_id:, member_ids: SKIP, additional_properties: {}) @subscription_id = subscription_id @member_ids = member_ids unless member_ids == SKIP # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#member_ids ⇒ Array[Integer]
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 18 def member_ids @member_ids end |
#subscription_id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 14 def subscription_id @subscription_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : nil member_ids = hash.key?('member_ids') ? hash['member_ids'] : SKIP # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. CreateSubscriptionGroup.new(subscription_id: subscription_id, member_ids: member_ids, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['subscription_id'] = 'subscription_id' @_hash['member_ids'] = 'member_ids' @_hash end |
.nullables ⇒ Object
An array for nullable fields
36 37 38 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 36 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 29 def self.optionals %w[ member_ids ] end |