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



166
167
168
169
170
# File 'lib/chargebee/result.rb', line 166

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

#addressObject



188
189
190
191
# File 'lib/chargebee/result.rb', line 188

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



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

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



264
265
266
267
# File 'lib/chargebee/result.rb', line 264

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



204
205
206
207
# File 'lib/chargebee/result.rb', line 204

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



172
173
174
175
176
# File 'lib/chargebee/result.rb', line 172

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

#coupon_codeObject



183
184
185
186
# File 'lib/chargebee/result.rb', line 183

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

#coupon_setObject



178
179
180
181
# File 'lib/chargebee/result.rb', line 178

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



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

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



269
270
271
272
273
# File 'lib/chargebee/result.rb', line 269

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

#differential_pricesObject



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

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

#downloadObject



209
210
211
212
# File 'lib/chargebee/result.rb', line 209

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

#downloadsObject



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

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

#entitlement_overrideObject



293
294
295
296
297
# File 'lib/chargebee/result.rb', line 293

def entitlement_override() 
    entitlement_override = get(:entitlement_override, EntitlementOverride,
    {:embedded_resource => EntitlementOverride::EmbeddedResource});
    return entitlement_override;
end

#estimateObject



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

def estimate() 
    estimate = get(:estimate, Estimate, {},
    {:subscription_estimate => 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], :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



198
199
200
201
202
# File 'lib/chargebee/result.rb', line 198

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

#exportObject



235
236
237
238
239
# File 'lib/chargebee/result.rb', line 235

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

#featureObject



275
276
277
278
279
# File 'lib/chargebee/result.rb', line 275

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



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

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

#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



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

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



252
253
254
255
256
# File 'lib/chargebee/result.rb', line 252

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

#item_entitlementObject



287
288
289
290
291
# File 'lib/chargebee/result.rb', line 287

def item_entitlement() 
    item_entitlement = get(:item_entitlement, ItemEntitlement,
    {:embedded_resource => ItemEntitlement::EmbeddedResource});
    return item_entitlement;
end

#item_familyObject



247
248
249
250
# File 'lib/chargebee/result.rb', line 247

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

#item_priceObject



258
259
260
261
262
# File 'lib/chargebee/result.rb', line 258

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



241
242
243
244
245
# File 'lib/chargebee/result.rb', line 241

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



160
161
162
163
164
# File 'lib/chargebee/result.rb', line 160

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



214
215
216
217
218
# File 'lib/chargebee/result.rb', line 214

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

#quoteObject



136
137
138
139
140
# File 'lib/chargebee/result.rb', line 136

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



154
155
156
157
158
# File 'lib/chargebee/result.rb', line 154

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



148
149
150
151
152
# File 'lib/chargebee/result.rb', line 148

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



142
143
144
145
146
# File 'lib/chargebee/result.rb', line 142

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



225
226
227
228
# File 'lib/chargebee/result.rb', line 225

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

#site_migration_detailObject



220
221
222
223
# File 'lib/chargebee/result.rb', line 220

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



281
282
283
284
285
# File 'lib/chargebee/result.rb', line 281

def subscription_entitlement() 
    subscription_entitlement = get(:subscription_entitlement, SubscriptionEntitlement,
    {:component => SubscriptionEntitlement::Component, :embedded_resource => SubscriptionEntitlement::EmbeddedResource});
    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



230
231
232
233
# File 'lib/chargebee/result.rb', line 230

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

#to_s(*args) ⇒ Object



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

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



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

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

#usageObject



193
194
195
196
# File 'lib/chargebee/result.rb', line 193

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