com.chargebee.models.InvoiceEstimate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of chargebee-java Show documentation
Show all versions of chargebee-java Show documentation
Java client library for ChargeBee API
package com.chargebee.models;
import com.chargebee.*;
import com.chargebee.internal.*;
import com.chargebee.filters.*;
import com.chargebee.filters.enums.SortOrder;
import com.chargebee.internal.HttpUtil.Method;
import com.chargebee.models.enums.*;
import org.json.*;
import java.io.*;
import java.sql.Timestamp;
import java.util.*;
public class InvoiceEstimate extends Resource {
public static class LineItem extends Resource {
public enum EntityType {
PLAN_SETUP,PLAN,ADDON,ADHOC,
_UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a
java-client version incompatibility. We suggest you to upgrade to the latest version */
}
public LineItem(JSONObject jsonObj) {
super(jsonObj);
}
public String id() {
return optString("id");
}
public String subscriptionId() {
return optString("subscription_id");
}
public Timestamp dateFrom() {
return reqTimestamp("date_from");
}
public Timestamp dateTo() {
return reqTimestamp("date_to");
}
public Integer unitAmount() {
return reqInteger("unit_amount");
}
public Integer quantity() {
return optInteger("quantity");
}
public Integer amount() {
return optInteger("amount");
}
public PricingModel pricingModel() {
return optEnum("pricing_model", PricingModel.class);
}
public Boolean isTaxed() {
return reqBoolean("is_taxed");
}
public Integer taxAmount() {
return optInteger("tax_amount");
}
public Double taxRate() {
return optDouble("tax_rate");
}
public Integer discountAmount() {
return optInteger("discount_amount");
}
public Integer itemLevelDiscountAmount() {
return optInteger("item_level_discount_amount");
}
public String description() {
return reqString("description");
}
public String entityDescription() {
return reqString("entity_description");
}
public EntityType entityType() {
return reqEnum("entity_type", EntityType.class);
}
public TaxExemptReason taxExemptReason() {
return optEnum("tax_exempt_reason", TaxExemptReason.class);
}
public String entityId() {
return optString("entity_id");
}
public String customerId() {
return optString("customer_id");
}
}
public static class Discount extends Resource {
public enum EntityType {
ITEM_LEVEL_COUPON,DOCUMENT_LEVEL_COUPON,PROMOTIONAL_CREDITS,PRORATED_CREDITS,
_UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a
java-client version incompatibility. We suggest you to upgrade to the latest version */
}
public Discount(JSONObject jsonObj) {
super(jsonObj);
}
public Integer amount() {
return reqInteger("amount");
}
public String description() {
return optString("description");
}
public EntityType entityType() {
return reqEnum("entity_type", EntityType.class);
}
public String entityId() {
return optString("entity_id");
}
}
public static class Tax extends Resource {
public Tax(JSONObject jsonObj) {
super(jsonObj);
}
public String name() {
return reqString("name");
}
public Integer amount() {
return reqInteger("amount");
}
public String description() {
return optString("description");
}
}
public static class LineItemTax extends Resource {
public LineItemTax(JSONObject jsonObj) {
super(jsonObj);
}
public String lineItemId() {
return optString("line_item_id");
}
public String taxName() {
return reqString("tax_name");
}
public Double taxRate() {
return reqDouble("tax_rate");
}
public Boolean isPartialTaxApplied() {
return optBoolean("is_partial_tax_applied");
}
public Boolean isNonComplianceTax() {
return optBoolean("is_non_compliance_tax");
}
public Integer taxableAmount() {
return reqInteger("taxable_amount");
}
public Integer taxAmount() {
return reqInteger("tax_amount");
}
public TaxJurisType taxJurisType() {
return optEnum("tax_juris_type", TaxJurisType.class);
}
public String taxJurisName() {
return optString("tax_juris_name");
}
public String taxJurisCode() {
return optString("tax_juris_code");
}
public Integer taxAmountInLocalCurrency() {
return optInteger("tax_amount_in_local_currency");
}
public String localCurrencyCode() {
return optString("local_currency_code");
}
}
public static class LineItemTier extends Resource {
public LineItemTier(JSONObject jsonObj) {
super(jsonObj);
}
public String lineItemId() {
return optString("line_item_id");
}
public Integer startingUnit() {
return reqInteger("starting_unit");
}
public Integer endingUnit() {
return optInteger("ending_unit");
}
public Integer quantityUsed() {
return reqInteger("quantity_used");
}
public Integer unitAmount() {
return reqInteger("unit_amount");
}
}
public static class LineItemDiscount extends Resource {
public enum DiscountType {
ITEM_LEVEL_COUPON,DOCUMENT_LEVEL_COUPON,PROMOTIONAL_CREDITS,PRORATED_CREDITS,
_UNKNOWN; /*Indicates unexpected value for this enum. You can get this when there is a
java-client version incompatibility. We suggest you to upgrade to the latest version */
}
public LineItemDiscount(JSONObject jsonObj) {
super(jsonObj);
}
public String lineItemId() {
return reqString("line_item_id");
}
public DiscountType discountType() {
return reqEnum("discount_type", DiscountType.class);
}
public String couponId() {
return optString("coupon_id");
}
public Integer discountAmount() {
return reqInteger("discount_amount");
}
}
//Constructors
//============
public InvoiceEstimate(String jsonStr) {
super(jsonStr);
}
public InvoiceEstimate(JSONObject jsonObj) {
super(jsonObj);
}
// Fields
//=======
public Boolean recurring() {
return reqBoolean("recurring");
}
public PriceType priceType() {
return reqEnum("price_type", PriceType.class);
}
public String currencyCode() {
return reqString("currency_code");
}
public Integer subTotal() {
return reqInteger("sub_total");
}
public Integer total() {
return optInteger("total");
}
public Integer creditsApplied() {
return optInteger("credits_applied");
}
public Integer amountPaid() {
return optInteger("amount_paid");
}
public Integer amountDue() {
return optInteger("amount_due");
}
public List lineItems() {
return optList("line_items", InvoiceEstimate.LineItem.class);
}
public List discounts() {
return optList("discounts", InvoiceEstimate.Discount.class);
}
public List taxes() {
return optList("taxes", InvoiceEstimate.Tax.class);
}
public List lineItemTaxes() {
return optList("line_item_taxes", InvoiceEstimate.LineItemTax.class);
}
public List lineItemTiers() {
return optList("line_item_tiers", InvoiceEstimate.LineItemTier.class);
}
public List lineItemDiscounts() {
return optList("line_item_discounts", InvoiceEstimate.LineItemDiscount.class);
}
public Integer roundOffAmount() {
return optInteger("round_off_amount");
}
public String customerId() {
return optString("customer_id");
}
// Operations
//===========
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy