Class: ChargeBee::Coupon

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

Defined Under Namespace

Classes: CouponConstraint, ItemConstraint, ItemConstraintCriteria

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Model

construct, #init_dependant, #init_dependant_list, #initialize, #inspect, #load, #method_missing, #replace_white_space_with_underscore, #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.



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

def addon_constraint
  @addon_constraint
end

#addon_idsObject

Returns the value of attribute addon_ids.



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

def addon_ids
  @addon_ids
end

#apply_discount_onObject

Returns the value of attribute apply_discount_on.



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

def apply_discount_on
  @apply_discount_on
end

#apply_onObject

Returns the value of attribute apply_on.



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

def apply_on
  @apply_on
end

#archived_atObject

Returns the value of attribute archived_at.



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

def archived_at
  @archived_at
end

#coupon_constraintsObject

Returns the value of attribute coupon_constraints.



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

def coupon_constraints
  @coupon_constraints
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#currency_codeObject

Returns the value of attribute currency_code.



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

def currency_code
  @currency_code
end

#deletedObject

Returns the value of attribute deleted.



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

def deleted
  @deleted
end

#discount_amountObject

Returns the value of attribute discount_amount.



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

def discount_amount
  @discount_amount
end

#discount_percentageObject

Returns the value of attribute discount_percentage.



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

def discount_percentage
  @discount_percentage
end

#discount_quantityObject

Returns the value of attribute discount_quantity.



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

def discount_quantity
  @discount_quantity
end

#discount_typeObject

Returns the value of attribute discount_type.



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

def discount_type
  @discount_type
end

#duration_monthObject

Returns the value of attribute duration_month.



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

def duration_month
  @duration_month
end

#duration_typeObject

Returns the value of attribute duration_type.



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

def duration_type
  @duration_type
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#included_in_mrrObject

Returns the value of attribute included_in_mrr.



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

def included_in_mrr
  @included_in_mrr
end

#invoice_nameObject

Returns the value of attribute invoice_name.



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

def invoice_name
  @invoice_name
end

#invoice_notesObject

Returns the value of attribute invoice_notes.



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

def invoice_notes
  @invoice_notes
end

#item_constraint_criteriaObject

Returns the value of attribute item_constraint_criteria.



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

def item_constraint_criteria
  @item_constraint_criteria
end

#item_constraintsObject

Returns the value of attribute item_constraints.



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

def item_constraints
  @item_constraints
end

#max_redemptionsObject

Returns the value of attribute max_redemptions.



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

def max_redemptions
  @max_redemptions
end

#meta_dataObject

Returns the value of attribute meta_data.



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

def 
  @meta_data
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#periodObject

Returns the value of attribute period.



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

def period
  @period
end

#period_unitObject

Returns the value of attribute period_unit.



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

def period_unit
  @period_unit
end

#plan_constraintObject

Returns the value of attribute plan_constraint.



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

def plan_constraint
  @plan_constraint
end

#plan_idsObject

Returns the value of attribute plan_ids.



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

def plan_ids
  @plan_ids
end

#redemptionsObject

Returns the value of attribute redemptions.



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

def redemptions
  @redemptions
end

#resource_versionObject

Returns the value of attribute resource_version.



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

def resource_version
  @resource_version
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#valid_fromObject

Returns the value of attribute valid_from.



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

def valid_from
  @valid_from
end

#valid_tillObject

Returns the value of attribute valid_till.



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

def valid_till
  @valid_till
end

Class Method Details

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



80
81
82
83
84
# File 'lib/chargebee/models/coupon.rb', line 80

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

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

OPERATIONS




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

def self.create(params, env=nil, headers={})
  jsonKeys = { 
      :meta_data => 0,
  }
  Request.send('post', uri_path("coupons"), params, env, headers,nil, false, jsonKeys)
end

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



33
34
35
36
37
38
39
40
41
42
# File 'lib/chargebee/models/coupon.rb', line 33

def self.create_for_items(params, env=nil, headers={})
  jsonKeys = { 
      :meta_data => 0,
      :item_price_ids => 1,
      :item_family_ids => 1,
      :currencies => 1,
      :item_price_periods => 1,
  }
  Request.send('post', uri_path("coupons","create_for_items"), params, env, headers,nil, false, jsonKeys)
end

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



74
75
76
77
78
# File 'lib/chargebee/models/coupon.rb', line 74

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

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



55
56
57
58
59
# File 'lib/chargebee/models/coupon.rb', line 55

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

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



61
62
63
64
65
# File 'lib/chargebee/models/coupon.rb', line 61

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

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



86
87
88
89
90
# File 'lib/chargebee/models/coupon.rb', line 86

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

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



67
68
69
70
71
72
# File 'lib/chargebee/models/coupon.rb', line 67

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

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



44
45
46
47
48
49
50
51
52
53
# File 'lib/chargebee/models/coupon.rb', line 44

def self.update_for_items(id, params, env=nil, headers={})
  jsonKeys = { 
      :meta_data => 0,
      :item_price_ids => 1,
      :item_family_ids => 1,
      :currencies => 1,
      :item_price_periods => 1,
  }
  Request.send('post', uri_path("coupons",id.to_s,"update_for_items"), params, env, headers,nil, false, jsonKeys)
end