Class: ChargeBee::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/chargebee/result.rb

Direct Known Subclasses

Event::Content, HostedPage::Content

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Result

Returns a new instance of Result.



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

def initialize(response)
  @response = response
end

Instance Method Details

#addonObject



168
169
170
171
172
# File 'lib/chargebee/result.rb', line 168

def addon() 
    addon = get(:addon, Addon,
    {:tiers => Addon::Tier});
    return addon;
end

#addressObject



190
191
192
193
# File 'lib/chargebee/result.rb', line 190

def address() 
    address = get(:address, Address);
    return address;
end

#advance_invoice_scheduleObject



19
20
21
22
23
# File 'lib/chargebee/result.rb', line 19

def advance_invoice_schedule() 
    advance_invoice_schedule = get(:advance_invoice_schedule, AdvanceInvoiceSchedule,
    {:fixed_interval_schedule => AdvanceInvoiceSchedule::FixedIntervalSchedule, :specific_dates_schedule => AdvanceInvoiceSchedule::SpecificDatesSchedule});
    return advance_invoice_schedule;
end

#advance_invoice_schedulesObject



329
330
331
332
333
# File 'lib/chargebee/result.rb', line 329

def advance_invoice_schedules()
    advance_invoice_schedules = get_list(:advance_invoice_schedules, AdvanceInvoiceSchedule,
    {:fixed_interval_schedule => AdvanceInvoiceSchedule::FixedIntervalSchedule, :specific_dates_schedule => AdvanceInvoiceSchedule::SpecificDatesSchedule});
    return advance_invoice_schedules;
end

#attached_itemObject



266
267
268
269
# File 'lib/chargebee/result.rb', line 266

def attached_item() 
    attached_item = get(:attached_item, AttachedItem);
    return attached_item;
end

#cardObject



62
63
64
65
# File 'lib/chargebee/result.rb', line 62

def card() 
    card = get(:card, Card);
    return card;
end

#commentObject



206
207
208
209
# File 'lib/chargebee/result.rb', line 206

def comment() 
    comment = get(:comment, Comment);
    return comment;
end

#contactObject



36
37
38
39
# File 'lib/chargebee/result.rb', line 36

def contact() 
    contact = get(:contact, Contact);
    return contact;
end

#contract_termObject



14
15
16
17
# File 'lib/chargebee/result.rb', line 14

def contract_term() 
    contract_term = get(:contract_term, ContractTerm);
    return contract_term;
end

#couponObject



174
175
176
177
178
# File 'lib/chargebee/result.rb', line 174

def coupon() 
    coupon = get(:coupon, Coupon,
    {:item_constraints => Coupon::ItemConstraint, :item_constraint_criteria => Coupon::ItemConstraintCriteria});
    return coupon;
end

#coupon_codeObject



185
186
187
188
# File 'lib/chargebee/result.rb', line 185

def coupon_code() 
    coupon_code = get(:coupon_code, CouponCode);
    return coupon_code;
end

#coupon_setObject



180
181
182
183
# File 'lib/chargebee/result.rb', line 180

def coupon_set() 
    coupon_set = get(:coupon_set, CouponSet);
    return coupon_set;
end

#credit_noteObject



83
84
85
86
87
# File 'lib/chargebee/result.rb', line 83

def credit_note() 
    credit_note = get(:credit_note, CreditNote,
    {:einvoice => CreditNote::Einvoice, :line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :line_item_tiers => CreditNote::LineItemTier, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation});
    return credit_note;
end

#credit_notesObject



323
324
325
326
327
# File 'lib/chargebee/result.rb', line 323

def credit_notes()
    credit_notes = get_list(:credit_notes, CreditNote,
    {:einvoice => CreditNote::Einvoice, :line_items => CreditNote::LineItem, :discounts => CreditNote::Discount, :line_item_discounts => CreditNote::LineItemDiscount, :line_item_tiers => CreditNote::LineItemTier, :taxes => CreditNote::Tax, :line_item_taxes => CreditNote::LineItemTax, :linked_refunds => CreditNote::LinkedRefund, :allocations => CreditNote::Allocation});
    return credit_notes;
end

#customerObject



25
26
27
28
29
# File 'lib/chargebee/result.rb', line 25

def customer() 
    customer = get(:customer, Customer,
    {:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance, :entity_identifiers => Customer::EntityIdentifier, :relationship => Customer::Relationship, :parent_account_access => Customer::ParentAccountAccess, :child_account_access => Customer::ChildAccountAccess});
    return customer;
end

#differential_priceObject



271
272
273
274
275
# File 'lib/chargebee/result.rb', line 271

def differential_price() 
    differential_price = get(:differential_price, DifferentialPrice,
    {:tiers => DifferentialPrice::Tier, :parent_periods => DifferentialPrice::ParentPeriod});
    return differential_price;
end

#differential_pricesObject



353
354
355
356
357
# File 'lib/chargebee/result.rb', line 353

def differential_prices()
    differential_prices = get_list(:differential_prices, DifferentialPrice,
    {:tiers => DifferentialPrice::Tier, :parent_periods => DifferentialPrice::ParentPeriod});
    return differential_prices;
end

#downloadObject



211
212
213
214
# File 'lib/chargebee/result.rb', line 211

def download() 
    download = get(:download, Download);
    return download;
end

#downloadsObject



341
342
343
344
345
# File 'lib/chargebee/result.rb', line 341

def downloads()
    downloads = get_list(:downloads, Download,
    {});
    return downloads;
end

#entitlement_overrideObject



306
307
308
309
# File 'lib/chargebee/result.rb', line 306

def entitlement_override() 
    entitlement_override = get(:entitlement_override, EntitlementOverride);
    return entitlement_override;
end

#estimateObject



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/chargebee/result.rb', line 118

def estimate() 
    estimate = get(:estimate, Estimate, {},
    {:subscription_estimate => SubscriptionEstimate, :subscription_estimates => SubscriptionEstimate, :invoice_estimate => InvoiceEstimate, :invoice_estimates => InvoiceEstimate, :next_invoice_estimate => InvoiceEstimate, :credit_note_estimates => CreditNoteEstimate, :unbilled_charge_estimates => UnbilledCharge});
    estimate.init_dependant(@response[:estimate], :subscription_estimate,
    {:shipping_address => SubscriptionEstimate::ShippingAddress, :contract_term => SubscriptionEstimate::ContractTerm});
    estimate.init_dependant(@response[:estimate], :invoice_estimate,
    {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_tiers => InvoiceEstimate::LineItemTier, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
    estimate.init_dependant(@response[:estimate], :next_invoice_estimate,
    {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_tiers => InvoiceEstimate::LineItemTier, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
    estimate.init_dependant_list(@response[:estimate], :subscription_estimates,
    {:shipping_address => SubscriptionEstimate::ShippingAddress, :contract_term => SubscriptionEstimate::ContractTerm});
    estimate.init_dependant_list(@response[:estimate], :invoice_estimates,
    {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_tiers => InvoiceEstimate::LineItemTier, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
    estimate.init_dependant_list(@response[:estimate], :credit_note_estimates,
    {:line_items => CreditNoteEstimate::LineItem, :discounts => CreditNoteEstimate::Discount, :taxes => CreditNoteEstimate::Tax, :line_item_taxes => CreditNoteEstimate::LineItemTax, :line_item_discounts => CreditNoteEstimate::LineItemDiscount, :line_item_tiers => CreditNoteEstimate::LineItemTier});
    estimate.init_dependant_list(@response[:estimate], :unbilled_charge_estimates,
    {:tiers => UnbilledCharge::Tier});
    return estimate;
end

#eventObject



200
201
202
203
204
# File 'lib/chargebee/result.rb', line 200

def event() 
    event = get(:event, Event,
    {:webhooks => Event::Webhook});
    return event;
end

#exportObject



237
238
239
240
241
# File 'lib/chargebee/result.rb', line 237

def export() 
    export = get(:export, Export,
    {:download => Export::Download});
    return export;
end

#featureObject



277
278
279
280
281
# File 'lib/chargebee/result.rb', line 277

def feature() 
    feature = get(:feature, Feature,
    {:levels => Feature::Level});
    return feature;
end

#giftObject



101
102
103
104
105
# File 'lib/chargebee/result.rb', line 101

def gift() 
    gift = get(:gift, Gift,
    {:gifter => Gift::Gifter, :gift_receiver => Gift::GiftReceiver, :gift_timelines => Gift::GiftTimeline});
    return gift;
end

#hierarchiesObject



335
336
337
338
339
# File 'lib/chargebee/result.rb', line 335

def hierarchies()
    hierarchies = get_list(:hierarchies, Hierarchy,
    {});
    return hierarchies;
end

#hierarchyObject



31
32
33
34
# File 'lib/chargebee/result.rb', line 31

def hierarchy() 
    hierarchy = get(:hierarchy, Hierarchy);
    return hierarchy;
end

#hosted_pageObject



113
114
115
116
# File 'lib/chargebee/result.rb', line 113

def hosted_page() 
    hosted_page = get(:hosted_page, HostedPage);
    return hosted_page;
end

#impacted_itemObject



289
290
291
292
293
# File 'lib/chargebee/result.rb', line 289

def impacted_item() 
    impacted_item = get(:impacted_item, ImpactedItem,
    {:download => ImpactedItem::Download});
    return impacted_item;
end

#impacted_subscriptionObject



283
284
285
286
287
# File 'lib/chargebee/result.rb', line 283

def impacted_subscription() 
    impacted_subscription = get(:impacted_subscription, ImpactedSubscription,
    {:download => ImpactedSubscription::Download});
    return impacted_subscription;
end

#invoiceObject



72
73
74
75
76
# File 'lib/chargebee/result.rb', line 72

def invoice() 
    invoice = get(:invoice, Invoice,
    {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :line_item_discounts => Invoice::LineItemDiscount, :taxes => Invoice::Tax, :line_item_taxes => Invoice::LineItemTax, :line_item_tiers => Invoice::LineItemTier, :linked_payments => Invoice::LinkedPayment, :dunning_attempts => Invoice::DunningAttempt, :applied_credits => Invoice::AppliedCredit, :adjustment_credit_notes => Invoice::AdjustmentCreditNote, :issued_credit_notes => Invoice::IssuedCreditNote, :linked_orders => Invoice::LinkedOrder, :notes => Invoice::Note, :shipping_address => Invoice::ShippingAddress, :billing_address => Invoice::BillingAddress, :einvoice => Invoice::Einvoice});
    return invoice;
end

#invoicesObject



347
348
349
350
351
# File 'lib/chargebee/result.rb', line 347

def invoices()
    invoices = get_list(:invoices, Invoice,
    {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :line_item_discounts => Invoice::LineItemDiscount, :taxes => Invoice::Tax, :line_item_taxes => Invoice::LineItemTax, :line_item_tiers => Invoice::LineItemTier, :linked_payments => Invoice::LinkedPayment, :dunning_attempts => Invoice::DunningAttempt, :applied_credits => Invoice::AppliedCredit, :adjustment_credit_notes => Invoice::AdjustmentCreditNote, :issued_credit_notes => Invoice::IssuedCreditNote, :linked_orders => Invoice::LinkedOrder, :notes => Invoice::Note, :shipping_address => Invoice::ShippingAddress, :billing_address => Invoice::BillingAddress, :einvoice => Invoice::Einvoice});
    return invoices;
end

#itemObject



254
255
256
257
258
# File 'lib/chargebee/result.rb', line 254

def item() 
    item = get(:item, Item,
    {:applicable_items => Item::ApplicableItem});
    return item;
end

#item_entitlementObject



301
302
303
304
# File 'lib/chargebee/result.rb', line 301

def item_entitlement() 
    item_entitlement = get(:item_entitlement, ItemEntitlement);
    return item_entitlement;
end

#item_familyObject



249
250
251
252
# File 'lib/chargebee/result.rb', line 249

def item_family() 
    item_family = get(:item_family, ItemFamily);
    return item_family;
end

#item_priceObject



260
261
262
263
264
# File 'lib/chargebee/result.rb', line 260

def item_price() 
    item_price = get(:item_price, ItemPrice,
    {:tiers => ItemPrice::Tier, :tax_detail => ItemPrice::TaxDetail, :accounting_detail => ItemPrice::AccountingDetail});
    return item_price;
end

#orderObject



95
96
97
98
99
# File 'lib/chargebee/result.rb', line 95

def order() 
    order = get(:order, Order,
    {:order_line_items => Order::OrderLineItem, :shipping_address => Order::ShippingAddress, :billing_address => Order::BillingAddress, :line_item_taxes => Order::LineItemTax, :line_item_discounts => Order::LineItemDiscount, :linked_credit_notes => Order::LinkedCreditNote, :resent_orders => Order::ResentOrder});
    return order;
end

#payment_intentObject



243
244
245
246
247
# File 'lib/chargebee/result.rb', line 243

def payment_intent() 
    payment_intent = get(:payment_intent, PaymentIntent,
    {:payment_attempt => PaymentIntent::PaymentAttempt});
    return payment_intent;
end

#payment_sourceObject



46
47
48
49
50
# File 'lib/chargebee/result.rb', line 46

def payment_source() 
    payment_source = get(:payment_source, PaymentSource,
    {:card => PaymentSource::Card, :bank_account => PaymentSource::BankAccount, :amazon_payment => PaymentSource::AmazonPayment, :upi => PaymentSource::Upi, :paypal => PaymentSource::Paypal, :mandates => PaymentSource::Mandate});
    return payment_source;
end

#planObject



162
163
164
165
166
# File 'lib/chargebee/result.rb', line 162

def plan() 
    plan = get(:plan, Plan,
    {:tiers => Plan::Tier, :applicable_addons => Plan::ApplicableAddon, :attached_addons => Plan::AttachedAddon, :event_based_addons => Plan::EventBasedAddon});
    return plan;
end

#portal_sessionObject



216
217
218
219
220
# File 'lib/chargebee/result.rb', line 216

def portal_session() 
    portal_session = get(:portal_session, PortalSession,
    {:linked_customers => PortalSession::LinkedCustomer});
    return portal_session;
end

#promotional_creditObject



67
68
69
70
# File 'lib/chargebee/result.rb', line 67

def promotional_credit() 
    promotional_credit = get(:promotional_credit, PromotionalCredit);
    return promotional_credit;
end

#purchaseObject



311
312
313
314
# File 'lib/chargebee/result.rb', line 311

def purchase() 
    purchase = get(:purchase, Purchase);
    return purchase;
end

#quoteObject



138
139
140
141
142
# File 'lib/chargebee/result.rb', line 138

def quote() 
    quote = get(:quote, Quote,
    {:line_items => Quote::LineItem, :discounts => Quote::Discount, :line_item_discounts => Quote::LineItemDiscount, :taxes => Quote::Tax, :line_item_taxes => Quote::LineItemTax, :line_item_tiers => Quote::LineItemTier, :shipping_address => Quote::ShippingAddress, :billing_address => Quote::BillingAddress});
    return quote;
end

#quote_line_groupObject



156
157
158
159
160
# File 'lib/chargebee/result.rb', line 156

def quote_line_group() 
    quote_line_group = get(:quote_line_group, QuoteLineGroup,
    {:line_items => QuoteLineGroup::LineItem, :discounts => QuoteLineGroup::Discount, :line_item_discounts => QuoteLineGroup::LineItemDiscount, :taxes => QuoteLineGroup::Tax, :line_item_taxes => QuoteLineGroup::LineItemTax});
    return quote_line_group;
end

#quoted_chargeObject



150
151
152
153
154
# File 'lib/chargebee/result.rb', line 150

def quoted_charge() 
    quoted_charge = get(:quoted_charge, QuotedCharge,
    {:charges => QuotedCharge::Charge, :addons => QuotedCharge::Addon, :invoice_items => QuotedCharge::InvoiceItem, :item_tiers => QuotedCharge::ItemTier, :coupons => QuotedCharge::Coupon});
    return quoted_charge;
end

#quoted_subscriptionObject



144
145
146
147
148
# File 'lib/chargebee/result.rb', line 144

def quoted_subscription() 
    quoted_subscription = get(:quoted_subscription, QuotedSubscription,
    {:addons => QuotedSubscription::Addon, :event_based_addons => QuotedSubscription::EventBasedAddon, :coupons => QuotedSubscription::Coupon, :subscription_items => QuotedSubscription::SubscriptionItem, :item_tiers => QuotedSubscription::ItemTier, :quoted_contract_term => QuotedSubscription::QuotedContractTerm});
    return quoted_subscription;
end

#resource_migrationObject



227
228
229
230
# File 'lib/chargebee/result.rb', line 227

def resource_migration() 
    resource_migration = get(:resource_migration, ResourceMigration);
    return resource_migration;
end

#site_migration_detailObject



222
223
224
225
# File 'lib/chargebee/result.rb', line 222

def site_migration_detail() 
    site_migration_detail = get(:site_migration_detail, SiteMigrationDetail);
    return site_migration_detail;
end

#subscriptionObject



8
9
10
11
12
# File 'lib/chargebee/result.rb', line 8

def subscription() 
    subscription = get(:subscription, Subscription,
    {:subscription_items => Subscription::SubscriptionItem, :item_tiers => Subscription::ItemTier, :charged_items => Subscription::ChargedItem, :addons => Subscription::Addon, :event_based_addons => Subscription::EventBasedAddon, :charged_event_based_addons => Subscription::ChargedEventBasedAddon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo, :contract_term => Subscription::ContractTerm});
    return subscription;
end

#subscription_entitlementObject



295
296
297
298
299
# File 'lib/chargebee/result.rb', line 295

def subscription_entitlement() 
    subscription_entitlement = get(:subscription_entitlement, SubscriptionEntitlement,
    {:component => SubscriptionEntitlement::Component});
    return subscription_entitlement;
end

#tax_withheldObject



78
79
80
81
# File 'lib/chargebee/result.rb', line 78

def tax_withheld() 
    tax_withheld = get(:tax_withheld, TaxWithheld);
    return tax_withheld;
end

#third_party_payment_methodObject



52
53
54
55
# File 'lib/chargebee/result.rb', line 52

def third_party_payment_method() 
    third_party_payment_method = get(:third_party_payment_method, ThirdPartyPaymentMethod);
    return third_party_payment_method;
end

#time_machineObject



232
233
234
235
# File 'lib/chargebee/result.rb', line 232

def time_machine() 
    time_machine = get(:time_machine, TimeMachine);
    return time_machine;
end

#to_s(*args) ⇒ Object



360
361
362
# File 'lib/chargebee/result.rb', line 360

def to_s(*args)
    JSON.pretty_generate(@response)
end

#tokenObject



41
42
43
44
# File 'lib/chargebee/result.rb', line 41

def token() 
    token = get(:token, Token);
    return token;
end

#transactionObject



107
108
109
110
111
# File 'lib/chargebee/result.rb', line 107

def transaction() 
    transaction = get(:transaction, Transaction,
    {:linked_invoices => Transaction::LinkedInvoice, :linked_credit_notes => Transaction::LinkedCreditNote, :linked_refunds => Transaction::LinkedRefund, :linked_payments => Transaction::LinkedPayment});
    return transaction;
end

#unbilled_chargeObject



89
90
91
92
93
# File 'lib/chargebee/result.rb', line 89

def unbilled_charge() 
    unbilled_charge = get(:unbilled_charge, UnbilledCharge,
    {:tiers => UnbilledCharge::Tier});
    return unbilled_charge;
end

#unbilled_chargesObject



317
318
319
320
321
# File 'lib/chargebee/result.rb', line 317

def unbilled_charges()
    unbilled_charges = get_list(:unbilled_charges, UnbilledCharge,
    {:tiers => UnbilledCharge::Tier});
    return unbilled_charges;
end

#usageObject



195
196
197
198
# File 'lib/chargebee/result.rb', line 195

def usage() 
    usage = get(:usage, Usage);
    return usage;
end

#virtual_bank_accountObject



57
58
59
60
# File 'lib/chargebee/result.rb', line 57

def () 
     = get(:virtual_bank_account, VirtualBankAccount);
    return ;
end