Class: ChargeBee::Coupon

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

Defined Under Namespace

Classes: 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, #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.



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

def addon_constraint
  @addon_constraint
end

#addon_idsObject

Returns the value of attribute addon_ids.



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

def addon_ids
  @addon_ids
end

#apply_discount_onObject

Returns the value of attribute apply_discount_on.



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

def apply_discount_on
  @apply_discount_on
end

#apply_onObject

Returns the value of attribute apply_on.



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

def apply_on
  @apply_on
end

#archived_atObject

Returns the value of attribute archived_at.



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

def archived_at
  @archived_at
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#currency_codeObject

Returns the value of attribute currency_code.



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

def currency_code
  @currency_code
end

#discount_amountObject

Returns the value of attribute discount_amount.



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

def discount_amount
  @discount_amount
end

#discount_percentageObject

Returns the value of attribute discount_percentage.



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

def discount_percentage
  @discount_percentage
end

#discount_quantityObject

Returns the value of attribute discount_quantity.



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

def discount_quantity
  @discount_quantity
end

#discount_typeObject

Returns the value of attribute discount_type.



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

def discount_type
  @discount_type
end

#duration_monthObject

Returns the value of attribute duration_month.



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

def duration_month
  @duration_month
end

#duration_typeObject

Returns the value of attribute duration_type.



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

def duration_type
  @duration_type
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#included_in_mrrObject

Returns the value of attribute included_in_mrr.



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

def included_in_mrr
  @included_in_mrr
end

#invoice_nameObject

Returns the value of attribute invoice_name.



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

def invoice_name
  @invoice_name
end

#invoice_notesObject

Returns the value of attribute invoice_notes.



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

def invoice_notes
  @invoice_notes
end

#item_constraint_criteriaObject

Returns the value of attribute item_constraint_criteria.



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

def item_constraint_criteria
  @item_constraint_criteria
end

#item_constraintsObject

Returns the value of attribute item_constraints.



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

def item_constraints
  @item_constraints
end

#max_redemptionsObject

Returns the value of attribute max_redemptions.



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

def max_redemptions
  @max_redemptions
end

#meta_dataObject

Returns the value of attribute meta_data.



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

def 
  @meta_data
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#periodObject

Returns the value of attribute period.



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

def period
  @period
end

#period_unitObject

Returns the value of attribute period_unit.



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

def period_unit
  @period_unit
end

#plan_constraintObject

Returns the value of attribute plan_constraint.



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

def plan_constraint
  @plan_constraint
end

#plan_idsObject

Returns the value of attribute plan_ids.



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

def plan_ids
  @plan_ids
end

#redemptionsObject

Returns the value of attribute redemptions.



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

def redemptions
  @redemptions
end

#resource_versionObject

Returns the value of attribute resource_version.



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

def resource_version
  @resource_version
end

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#updated_atObject

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#valid_tillObject

Returns the value of attribute valid_till.



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

def valid_till
  @valid_till
end

Class Method Details

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



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

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




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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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