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 ⇒ Object
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(subscription_id = nil, member_ids = SKIP) ⇒ CreateSubscriptionGroup
constructor
A new instance of CreateSubscriptionGroup.
Methods inherited from BaseModel
Constructor Details
#initialize(subscription_id = nil, member_ids = SKIP) ⇒ CreateSubscriptionGroup
Returns a new instance of CreateSubscriptionGroup.
40 41 42 43 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 40 def initialize(subscription_id = nil, member_ids = SKIP) @subscription_id = subscription_id @member_ids = member_ids unless member_ids == SKIP 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 ⇒ Object
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.
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 46 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. subscription_id = hash.key?('subscription_id') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:CreateSubscriptionGroupSubscriptionId), hash['subscription_id'] ) : nil member_ids = hash.key?('member_ids') ? hash['member_ids'] : SKIP # Create object from extracted values. CreateSubscriptionGroup.new(subscription_id, member_ids) 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 |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/advanced_billing/models/create_subscription_group.rb', line 62 def self.validate(value) if value.instance_of? self return UnionTypeLookUp.get(:CreateSubscriptionGroupSubscriptionId) .validate(value.subscription_id) end return false unless value.instance_of? Hash UnionTypeLookUp.get(:CreateSubscriptionGroupSubscriptionId) .validate(value['subscription_id']) end |