<commit_before>package stripe

import (
	"fmt"
	"net/url"
)

// Invoice represents statements of what a customer owes for a particular
// billing period, including subscriptions, invoice items, and any automatic
// proration adjustments if necessary.
//
// see https://stripe.com/docs/api#invoice_object
type Invoice struct {
	ID                 string        `json:"id"`
	AmountDue          int           `json:"amount_due"`
	AttemptCount       int           `json:"attempt_count"`
	Attempted          bool          `json:"attempted"`
	Closed             bool          `json:"closed"`
	Paid               bool          `json:"paid"`
	PeriodEnd          UnixTime      `json:"period_end"`
	PeriodStart        UnixTime      `json:"period_start"`
	Subtotal           int           `json:"subtotal"`
	Total              int           `json:"total"`
	Currency           string        `json:"currency"`
	Charge             string        `json:"charge,omitempty"`
	Customer           string        `json:"customer"`
	Date               UnixTime      `json:"date"`
	Discount           *Discount     `json:"discount,omitempty"`
	Lines              *InvoiceLines `json:"lines"`
	StartingBalance    int           `json:"starting_balance"`
	EndingBalance      int           `json:"ending_balance"`
	NextPaymentAttempt *UnixTime     `json:"next_payment_attempt,omitempty"`
	ApplicationFee     int           `json:"application_fee,omitempty"`
	Livemode           bool          `json:"livemode"`
}

// InvoiceLines represents an individual line items that is part of an invoice.
type InvoiceLines struct {
	ListObject
	Data []*InvoiceLineItem `json:"data"`
}

type InvoiceLineItem struct {
	ID          string            `json:"id"`
	Livemode    bool              `json:"livemode"`
	Amount      int               `json:"amount"`
	Currency    string            `json:"currency"`
	Period      Period            `json:"period"`
	Proration   bool              `json:"proration"`
	Type        string            `json:"type"`
	Description string            `json:"description,omitempty"`
	Metadata    map[string]string `json:"metadata"`
	Plan        *Plan             `json:"plan,omitempty"`
	Quantity    int               `json:"quantity"`
}

type Period struct {
	Start UnixTime `json:"start"`
	End   UnixTime `json:"end"`
}

type InvoiceParams struct {
	// The customer ID to invoice
	Customer string

	// (Optional) Invoice description
	Description string

	// (Optional) Invoice metadata
	Metadata map[string]string

	// (Optional) The ID of the subscription to invoice. If not set, the created
	// invoice will include all pending invoice items for the customer.
	Subscription string

	// (Optional) Boolean representing whether an invoice is closed or not.
	Closed *bool
}
<commit_msg>Add metadata/description to invoice type<commit_after>package stripe

import (
	"fmt"
	"net/url"
)

// Invoice represents statements of what a customer owes for a particular
// billing period, including subscriptions, invoice items, and any automatic
// proration adjustments if necessary.
//
// see https://stripe.com/docs/api#invoice_object
type Invoice struct {
	ID                 string            `json:"id"`
	AmountDue          int               `json:"amount_due"`
	AttemptCount       int               `json:"attempt_count"`
	Attempted          bool              `json:"attempted"`
	Closed             bool              `json:"closed"`
	Paid               bool              `json:"paid"`
	PeriodEnd          UnixTime          `json:"period_end"`
	PeriodStart        UnixTime          `json:"period_start"`
	Subtotal           int               `json:"subtotal"`
	Total              int               `json:"total"`
	Currency           string            `json:"currency"`
	Charge             string            `json:"charge,omitempty"`
	Customer           string            `json:"customer"`
	Date               UnixTime          `json:"date"`
	Discount           *Discount         `json:"discount,omitempty"`
	Lines              *InvoiceLines     `json:"lines"`
	StartingBalance    int               `json:"starting_balance"`
	EndingBalance      int               `json:"ending_balance"`
	NextPaymentAttempt *UnixTime         `json:"next_payment_attempt,omitempty"`
	Livemode           bool              `json:"livemode"`
	Metadata           map[string]string `json:"metadata"`
	Description        string            `json:"omitempty"`
}

// InvoiceLines represents an individual line items that is part of an invoice.
type InvoiceLines struct {
	ListObject
	Data []*InvoiceLineItem `json:"data"`
}

type InvoiceLineItem struct {
	ID          string            `json:"id"`
	Livemode    bool              `json:"livemode"`
	Amount      int               `json:"amount"`
	Currency    string            `json:"currency"`
	Period      Period            `json:"period"`
	Proration   bool              `json:"proration"`
	Type        string            `json:"type"`
	Description string            `json:"description,omitempty"`
	Metadata    map[string]string `json:"metadata"`
	Plan        *Plan             `json:"plan,omitempty"`
	Quantity    int               `json:"quantity,omitempty"`
}

type Period struct {
	Start UnixTime `json:"start"`
	End   UnixTime `json:"end"`
}

type InvoiceParams struct {
	// The customer ID to invoice
	Customer string

	// (Optional) Invoice description
	Description string

	// (Optional) Invoice metadata
	Metadata map[string]string

	// (Optional) The ID of the subscription to invoice. If not set, the created
	// invoice will include all pending invoice items for the customer.
	Subscription string

	// (Optional) Boolean representing whether an invoice is closed or not.
	Closed *bool
}

{'fraction_non_alphanumeric': 0.09293354374890408, 'fraction_numerical': 0.0, 'mean_word_length': 2.1306256860592754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1937195', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1441, 'n_words': 443}