<commit_before>package balanced

import (
	"fmt"
	"net/http"
	"time"
)

type CardService struct {
	client *Client
}

type Card struct {
	// Expiration month (e.g., 1 for January); required
	ExpirationMonth int `json:"expiration_month"`

	// Expiration year; required
	ExpirationYear int `json:"expiration_year"`

	// The digits of the credit card number; required
	Number string `json:"number"`

	*Address `json:"address,omitempty"`

	// The customer this card is associated to
	Customer string `json:"customer,omitempty"`

	// The 3-4 digit security code for the card
	Cvv string `json:"cvv,omitempty"`

	// The customer's name on card
	Name string `json:"name,omitempty"`

	AvsPostalMatch interface{} `json:"avs_postal_match,omitempty"`

	AvsResult interface{} `json:"avs_result,omitempty"`

	AvsStreetMatch interface{} `json:"avs_street_match,omitempty"`

	// e.g., "MasterCard"
	Brand string `json:"brand,omitempty"`

	// e.g., "yes"
	CvvMatch string `json:"cvv_match,omitempty"`

	// e.g., "Match"
	CvvResult string `json:"cvv_result,omitempty"`

	Fingerprint string `json:"fingerprint,omitempty"`

	Meta map[string]string `json:"meta,omitempty"`

	// e.g., "/cards/CC2t9628l4ecJics6T8RuLPf"
	Href string `json:"href,omitempty"`

	Id string `json:"id,omitempty"`

	// e.g., "customer" => null
	Links map[string]string `json:"links,omitempty"`

	IsVerified bool `json:"is_verified,omitempty"`

	CreatedAt *time.Time `json:"created_at,omitempty"`
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
}

type CardResponse struct {
	Cards []Card                 `json:"cards"`
	Links *CardResponseLinks     `json:"links"`
	Meta  map[string]interface{} `json:"meta"`
}

type CardResponseLinks struct {
	CardHolds string `json:"cards.card_holds"`
	Customers string `json:"cards.customers"`
	Debits    string `json:"cards.debits"`
}

type CardPage struct {
	Cards []Card
	*PaginationParams
}

// Creates a card on the server.
//
// Fraud and Card declinations can be reduced if the following information is
// supplied when tokenizing a card:<commit_msg>go fmt for Card struct<commit_after>package balanced

import (
	"fmt"
	"net/http"
	"time"
)

type CardService struct {
	client *Client
}

type Card struct {
	ExpirationMonth int    `json:"expiration_month"` // Expiration month (e.g., 1 for January); required
	ExpirationYear  int    `json:"expiration_year"`  // Expiration year; required
	Number          string `json:"number"`           // The digits of the credit card number; required
	*Address        `json:"address,omitempty"`
	Customer        string            `json:"customer,omitempty"` // The customer this card is associated to
	Cvv             string            `json:"cvv,omitempty"`      // The 3-4 digit security code for the card
	Name            string            `json:"name,omitempty"`     // The customer's name on card
	AvsPostalMatch  interface{}       `json:"avs_postal_match,omitempty"`
	AvsResult       interface{}       `json:"avs_result,omitempty"`
	AvsStreetMatch  interface{}       `json:"avs_street_match,omitempty"`
	Brand           string            `json:"brand,omitempty"`      // e.g., "MasterCard"
	CvvMatch        string            `json:"cvv_match,omitempty"`  // e.g., "yes"
	CvvResult       string            `json:"cvv_result,omitempty"` // e.g., "Match"
	Fingerprint     string            `json:"fingerprint,omitempty"`
	Meta            map[string]string `json:"meta,omitempty"`
	Href            string            `json:"href,omitempty"` // e.g., "/cards/CC2t9628l4ecJics6T8RuLPf"
	Id              string            `json:"id,omitempty"`
	Links           *CardLinks        `json:"links,omitempty"`
	IsVerified      bool              `json:"is_verified,omitempty"`
	CreatedAt       *time.Time        `json:"created_at,omitempty"`
	UpdatedAt       *time.Time        `json:"updated_at,omitempty"`

}

type CardResponse struct {
	Cards []Card                 `json:"cards"`
	Links *CardResponseLinks     `json:"links"`
	Meta  map[string]interface{} `json:"meta"`
}

type CardResponseLinks struct {
	CardHolds string `json:"cards.card_holds"`
	Customers string `json:"cards.customers"`
	Debits    string `json:"cards.debits"`
}

type CardPage struct {
	Cards []Card
	*PaginationParams
}

// Creates a card on the server.
//
// Fraud and Card declinations can be reduced if the following information is
// supplied when tokenizing a card:
{'fraction_non_alphanumeric': 0.12345679012345678, 'fraction_numerical': 0.005029721079103796, 'mean_word_length': 3.392570281124498, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '6655388', 'n_tokens_mistral': 1369, 'n_tokens_neox': 1325, 'n_words': 356}