Class: CloudRailSi::Types::Subscription

Inherits:
SandboxObject show all
Defined in:
lib/cloudrail_si/types/Subscription.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SandboxObject

#get, #set

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

#createdObject (readonly)

Returns the value of attribute created.



8
9
10
# File 'lib/cloudrail_si/types/Subscription.rb', line 8

def created
  @created
end

#credit_cardObject (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

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/cloudrail_si/types/Subscription.rb', line 8

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/cloudrail_si/types/Subscription.rb', line 8

def id
  @id
end

#last_chargeObject (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

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/cloudrail_si/types/Subscription.rb', line 8

def name
  @name
end

#next_chargeObject (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

#stateObject (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_idObject (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