Class: CloudRailSi::Types::Subscription
- Inherits:
-
SandboxObject
- Object
- SandboxObject
- CloudRailSi::Types::Subscription
- Defined in:
- lib/cloudrail_si/types/Subscription.rb
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#credit_card ⇒ Object
readonly
Returns the value of attribute credit_card.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_charge ⇒ Object
readonly
Returns the value of attribute last_charge.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#next_charge ⇒ Object
readonly
Returns the value of attribute next_charge.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#subscription_plan_id ⇒ Object
readonly
Returns the value of attribute subscription_plan_id.
Instance Method Summary collapse
-
#initialize(created, description, id, last_charge, name, next_charge, credit_card, state, subscription_plan_id) ⇒ Subscription
constructor
A new instance of Subscription.
Methods inherited from SandboxObject
Constructor Details
#initialize(created, description, id, last_charge, name, next_charge, credit_card, state, subscription_plan_id) ⇒ Subscription
Returns a new instance of Subscription.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 10 def initialize(created, description, id, last_charge, name, next_charge, credit_card, state, subscription_plan_id) super() @created = created @description = description @id = id @last_charge = last_charge @name = name @next_charge = next_charge @credit_card = credit_card @state = state @subscription_plan_id = subscription_plan_id raise Errors::IllegalArgumentError.new("At least one of the parameters is undefined.") if description.nil? || id.nil? || name.nil? || credit_card.nil? || state.nil? || subscription_plan_id.nil? raise Errors::IllegalArgumentError.new("Unknown state. Allowed values are: 'active' or 'canceled'.") if (["active", "cancelled"].index(state) < 0) end |
Instance Attribute Details
#created ⇒ Object (readonly)
Returns the value of attribute created.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def created @created end |
#credit_card ⇒ Object (readonly)
Returns the value of attribute credit_card.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def credit_card @credit_card end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def id @id end |
#last_charge ⇒ Object (readonly)
Returns the value of attribute last_charge.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def last_charge @last_charge end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def name @name end |
#next_charge ⇒ Object (readonly)
Returns the value of attribute next_charge.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def next_charge @next_charge end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def state @state end |
#subscription_plan_id ⇒ Object (readonly)
Returns the value of attribute subscription_plan_id.
8 9 10 |
# File 'lib/cloudrail_si/types/Subscription.rb', line 8 def subscription_plan_id @subscription_plan_id end |