package com.stripe.model;

import java.util.Map;

import com.stripe.exception.StripeException;
import com.stripe.net.APIResource;

public class Invoice extends APIResource {
	Integer subtotal;
	Integer total;
	Integer amountDue;
	Integer startingBalance;
	Integer endingBalance;
	String id;
	Long created;
	Long nextPaymentAttempt;
	Boolean attempted;
	String charge;
	Boolean closed;
	String customer;
	Long date;
	Boolean paid;
	Long periodStart;
	Long periodEnd;
	Discount discount;
	InvoiceLines lines;
	Boolean livemode;
	Integer attemptCount;
	
	public Integer getSubtotal() {
		return subtotal;
	}

	public void setSubtotal(Integer subtotal) {
		this.subtotal = subtotal;
	}

	public Integer getTotal() {
		return total;
	}

	public void setTotal(Integer total) {
		this.total = total;
	}

	public Integer getAmountDue() {
		return amountDue;
	}

	public void setAmountDue(Integer amountDue) {
		this.amountDue = amountDue;
	}

	public Integer getStartingBalance() {
		return startingBalance;
	}

	public void setStartingBalance(Integer startingBalance) {
		this.startingBalance = startingBalance;
	}

	public Integer getEndingBalance() {
		return endingBalance;
	}

	public void setEndingBalance(Integer endingBalance) {
		this.endingBalance = endingBalance;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Long getCreated() {
		return created;
	}

	public void setCreated(Long created) {
		this.created = created;
	}

	public Long getNextPaymentAttempt() {
		return nextPaymentAttempt;
	}

	public void setNextPaymentAttempt(Long nextPaymentAttempt) {
		this.nextPaymentAttempt = nextPaymentAttempt;
	}

	public Boolean getAttempted() {
		return attempted;
	}

	public void setAttempted(Boolean attempted) {
		this.attempted = attempted;
	}

	public String getCharge() {
		return charge;
	}

	public void setCharge(String charge) {
		this.charge = charge;
	}

	public Boolean getClosed() {
		return closed;
	}

	public void setClosed(Boolean closed) {
		this.closed = closed;
	}

	public String getCustomer() {
		return customer;
	}

	public void setCustomer(String customer) {
		this.customer = customer;
	}

	public Long getDate() {
		return date;
	}

	public void setDate(Long date) {
		this.date = date;
	}

	public Boolean getPaid() {
		return paid;
	}

	public void setPaid(Boolean paid) {
		this.paid = paid;
	}

	public Long getPeriodStart() {
		return periodStart;
	}

	public void setPeriodStart(Long periodStart) {
		this.periodStart = periodStart;
	}

	public Long getPeriodEnd() {
		return periodEnd;
	}

	public void setPeriodEnd(Long periodEnd) {
		this.periodEnd = periodEnd;
	}

	public Discount getDiscount() {
		return discount;
	}

	public void setDiscount(Discount discount) {
		this.discount = discount;
	}

	public InvoiceLines getLines() {
		return lines;
	}

	public void setLines(InvoiceLines lines) {
		this.lines = lines;
	}

	public Boolean getLivemode() {
		return livemode;
	}

	public void setLivemode(Boolean livemode) {
		this.livemode = livemode;
	}

	public Integer getAttemptCount() {
		return attemptCount;
	}

	public void setAttemptCount(Integer attemptCount) {
		this.attemptCount = attemptCount;
	}

	public static Invoice retrieve(String id) throws StripeException {
		return retrieve(id, null);
	}
	
	public static InvoiceCollection all(Map<String, Object> params) throws StripeException {
		return all(params, null);
	}
		
	public static Invoice upcoming(Map<String, Object> params) throws StripeException {
		return upcoming(params, null);
	}
	
	public static Invoice retrieve(String id, String apiKey) throws StripeException {
		return request(RequestMethod.GET, instanceURL(Invoice.class, id), null, Invoice.class, apiKey);
	}
	
	public static InvoiceCollection all(Map<String, Object> params, String apiKey) throws StripeException {
		return request(RequestMethod.GET, classURL(Invoice.class), params, InvoiceCollection.class, apiKey);
	}
		
	public static Invoice upcoming(Map<String, Object> params, String apiKey) throws StripeException {
		return request(RequestMethod.GET, String.format("%s/upcoming", classURL(Invoice.class)),
				params, Invoice.class, apiKey);
	}

}
@@ -542,17 +542,16 @@
 tCount;%0A
-%09
 %0A%09public
@@ -3293,34 +3293,33 @@
 e(id, null);%0A%09%7D%0A
-%09
 %0A
+
 %09public static I
@@ -3419,27 +3419,25 @@
 , null);%0A%09%7D%0A
-%09%09
 %0A
+
 %09public stat
@@ -3541,25 +3541,229 @@
 , null);%0A%09%7D%0A
-%09
+%0A%09public Invoice pay() throws StripeException %7B%0A        return this.pay(null);%0A    %7D%0A%0A    public Invoice update(Map%3CString, Object%3E params) throws StripeException %7B%0A    %09return update(params, null);%0A    %7D%0A
 %0A%09public sta
@@ -3935,18 +3935,17 @@
 ey);%0A%09%7D%0A
-%09
 %0A
+
 %09public 
@@ -4151,11 +4151,9 @@
 %0A%09%7D%0A
-%09%09
 %0A
+
 %09pub
@@ -4379,9 +4379,415 @@
 y);%0A%09%7D%0A%0A
+%09public Invoice update(Map%3CString, Object%3E params, String apiKey) throws StripeException %7B%0A%09%09return request(RequestMethod.POST, instanceURL(Invoice.class, this.id), params, Invoice.class, apiKey);%0A%09%7D%0A%0A%09public Invoice pay(String apiKey) throws StripeException %7B%0A%09%09return request(RequestMethod.POST,%0A%09%09%09%09String.format(%22%25s/pay%22, instanceURL(Invoice.class, this.getId())),%0A%09%09%09%09null, Invoice.class, apiKey);%0A%09%7D%0A
 %7D

Add invoice pay and update methods