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

#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_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



53
54
55
# File 'lib/chargebee/models/coupon.rb', line 53

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




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

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

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



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

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

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



49
50
51
# File 'lib/chargebee/models/coupon.rb', line 49

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



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

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



41
42
43
# File 'lib/chargebee/models/coupon.rb', line 41

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



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

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



45
46
47
# File 'lib/chargebee/models/coupon.rb', line 45

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

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



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

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