Class: ChargeBee::Coupon

Inherits:
Model
  • Object
show all
Defined in:
lib/chargebee/models/coupon.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

construct, #init_dependant, #init_dependant_list, #initialize, #inspect, #load, #method_missing, #to_s, uri_path

Constructor Details

This class inherits a constructor from ChargeBee::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ChargeBee::Model

Instance Attribute Details

#addon_constraintObject

Returns the value of attribute addon_constraint.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def addon_constraint
  @addon_constraint
end

#addon_idsObject

Returns the value of attribute addon_ids.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def addon_ids
  @addon_ids
end

#apply_discount_onObject

Returns the value of attribute apply_discount_on.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def apply_discount_on
  @apply_discount_on
end

#apply_onObject

Returns the value of attribute apply_on.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def apply_on
  @apply_on
end

#archived_atObject

Returns the value of attribute archived_at.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def archived_at
  @archived_at
end

#created_atObject

Returns the value of attribute created_at.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def created_at
  @created_at
end

#currency_codeObject

Returns the value of attribute currency_code.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def currency_code
  @currency_code
end

#discount_amountObject

Returns the value of attribute discount_amount.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_amount
  @discount_amount
end

#discount_percentageObject

Returns the value of attribute discount_percentage.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_percentage
  @discount_percentage
end

#discount_quantityObject

Returns the value of attribute discount_quantity.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_quantity
  @discount_quantity
end

#discount_typeObject

Returns the value of attribute discount_type.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def discount_type
  @discount_type
end

#duration_monthObject

Returns the value of attribute duration_month.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def duration_month
  @duration_month
end

#duration_typeObject

Returns the value of attribute duration_type.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def duration_type
  @duration_type
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def id
  @id
end

#invoice_nameObject

Returns the value of attribute invoice_name.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def invoice_name
  @invoice_name
end

#invoice_notesObject

Returns the value of attribute invoice_notes.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def invoice_notes
  @invoice_notes
end

#max_redemptionsObject

Returns the value of attribute max_redemptions.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def max_redemptions
  @max_redemptions
end

#meta_dataObject

Returns the value of attribute meta_data.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def 
  @meta_data
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def name
  @name
end

#plan_constraintObject

Returns the value of attribute plan_constraint.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def plan_constraint
  @plan_constraint
end

#plan_idsObject

Returns the value of attribute plan_ids.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def plan_ids
  @plan_ids
end

#redemptionsObject

Returns the value of attribute redemptions.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def redemptions
  @redemptions
end

#resource_versionObject

Returns the value of attribute resource_version.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def resource_version
  @resource_version
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def updated_at
  @updated_at
end

#valid_tillObject

Returns the value of attribute valid_till.



4
5
6
# File 'lib/chargebee/models/coupon.rb', line 4

def valid_till
  @valid_till
end

Class Method Details

.copy(params, env = nil, headers = {}) ⇒ Object



32
33
34
# File 'lib/chargebee/models/coupon.rb', line 32

def self.copy(params, env=nil, headers={})
  Request.send('post', uri_path("coupons","copy"), params, env, headers)
end

.create(params, env = nil, headers = {}) ⇒ Object

OPERATIONS




12
13
14
# File 'lib/chargebee/models/coupon.rb', line 12

def self.create(params, env=nil, headers={})
  Request.send('post', uri_path("coupons"), params, env, headers)
end

.delete(id, env = nil, headers = {}) ⇒ Object



28
29
30
# File 'lib/chargebee/models/coupon.rb', line 28

def self.delete(id, env=nil, headers={})
  Request.send('post', uri_path("coupons",id.to_s,"delete"), {}, env, headers)
end

.list(params = {}, env = nil, headers = {}) ⇒ Object



16
17
18
# File 'lib/chargebee/models/coupon.rb', line 16

def self.list(params={}, env=nil, headers={})
  Request.send_list_request('get', uri_path("coupons"), params, env, headers)
end

.retrieve(id, env = nil, headers = {}) ⇒ Object



20
21
22
# File 'lib/chargebee/models/coupon.rb', line 20

def self.retrieve(id, env=nil, headers={})
  Request.send('get', uri_path("coupons",id.to_s), {}, env, headers)
end

.unarchive(id, env = nil, headers = {}) ⇒ Object



36
37
38
# File 'lib/chargebee/models/coupon.rb', line 36

def self.unarchive(id, env=nil, headers={})
  Request.send('post', uri_path("coupons",id.to_s,"unarchive"), {}, env, headers)
end

.update(id, params = {}, env = nil, headers = {}) ⇒ Object



24
25
26
# File 'lib/chargebee/models/coupon.rb', line 24

def self.update(id, params={}, env=nil, headers={})
  Request.send('post', uri_path("coupons",id.to_s), params, env, headers)
end