func (c *Client) GetCardByName(ctx context.Context, name string, exact bool, opts GetCardByNameOptions) (Card, error) {
	values, err := qs.Values(opts)
	if err != nil {
		return Card{}, err
	}
	if exact {
		values.Set("exact", name)
	} else {
		values.Set("fuzzy", name)
	}
	cardURL := fmt.Sprintf("cards/named?%s", values.Encode())
	return c.getCard(ctx, cardURL)
}
GetCardByName returns a Card based on a name search string. This method is
designed for building chat bots, forum bots, and other services that need card
details quickly.

If the exact parameter is set to true, a card with that exact name is
returned. Otherwise, an error is returned because no card matches.

If the exact parameter is set to false and a card name matches that string,
then that card is returned. If not, a fuzzy search is executed for your card
name. The server allows misspellings and partial words to be provided. For
example: jac bel will match Jace Beleren.

When fuzzy searching, a card is returned if the server is confident that you
unambiguously identified a unique name with your string. Otherwise, you will
receive an error describing the problem: either more than 1 one card matched
your search, or zero cards matched.

For both exact and fuzzy, card names are case-insensitive and punctuation is
optional (you can drop apostrophes and periods etc). For example: fIReBALL is
the same as Fireball and smugglers copter is the same as Smuggler's Copter
package scryfall
import (
	"context"
	"fmt"
	"net/url"
	qs "github.com/google/go-querystring/query"
)
type Lang string
const (
	LangEnglish Lang = "en"
	LangSpanish Lang = "es"
	LangFrench Lang = "fr"
	LangGerman Lang = "de"
	LangItalian Lang = "it"
	LangPortuguese Lang = "pt"
	LangJapanese Lang = "ja"
	LangKorean Lang = "ko"
	LangRussian Lang = "ru"
	LangSimplifiedChinese Lang = "zhs"
	LangTraditionalChinese Lang = "zht"
	LangHebrew Lang = "he"
	LangLatin Lang = "la"
	LangAncientGreek Lang = "grc"
	LangArabic Lang = "ar"
	LangSanskrit Lang = "sa"
	LangPhyrexian Lang = "px"
)
type Layout string
const (
	LayoutNormal Layout = "normal"
	LayoutSplit Layout = "split"
	LayoutFlip Layout = "flip"
	LayoutTransform Layout = "transform"
	LayoutModalDFC Layout = "modal_dfc"
	LayoutMeld Layout = "meld"
	LayoutLeveler Layout = "leveler"
	LayoutSaga Layout = "saga"
	LayoutAdventure Layout = "adventure"
	LayoutPlanar Layout = "planar"
	LayoutScheme Layout = "scheme"
	LayoutVanguard Layout = "vanguard"
	LayoutToken Layout = "token"
	LayoutDoubleFacedToken Layout = "double_faced_token"
	LayoutEmblem Layout = "emblem"
	LayoutAugment Layout = "augment"
	LayoutHost Layout = "host"
	LayoutArtSeries Layout = "art_series"
	LayoutDoubleSided Layout = "double_sided"
)
type Legality string
const (
	LegalityLegal Legality = "legal"
	LegalityNotLegal Legality = "not_legal"
	LegalityBanned Legality = "banned"
	LegalityRestricted Legality = "restricted"
)
type Frame string
const (
	Frame1993 Frame = "1993"
	Frame1997 Frame = "1997"
	Frame2003 Frame = "2003"
	Frame2015 Frame = "2015"
	FrameFuture Frame = "future"
)
type FrameEffect string
const (
	FrameEffectLegendary FrameEffect = "legendary"
	FrameEffectMiracle FrameEffect = "miracle"
	FrameEffectNyxTouched FrameEffect = "nyxtouched"
	FrameEffectDraft FrameEffect = "draft"
	FrameEffectDevoid FrameEffect = "devoid"
	FrameEffectTombstone FrameEffect = "tombstone"
	FrameEffectColorShifted FrameEffect = "colorshifted"
	FrameEffectInverted FrameEffect = "inverted"
	FrameEffectSunMoonDFC FrameEffect = "sunmoondfc"
	FrameEffectCompassLandDFC FrameEffect = "compasslanddfc"
	FrameEffectOriginPWDFC FrameEffect = "originpwdfc"
	FrameEffectMoonEldraziDFC FrameEffect = "mooneldrazidfc"
	FrameEffectMoonReverseMoonDFC FrameEffect = "moonreversemoondfc"
	FrameEffectShowcase FrameEffect = "showcase"
	FrameEffectExtendedArt FrameEffect = "extendedart"
	FrameEffectCompanion FrameEffect = "companion"
)
type Preview struct {
	PreviewedAt Date `json:"previewed_at"`
	SourceURI string `json:"source_uri"`
	Source string `json:"source"`
}
type Component string
const (
	ComponentToken Component = "token"
	ComponentMeldPart Component = "meld_part"
	ComponentMeldResult Component = "meld_result"
	ComponentComboPiece Component = "combo_piece"
)
type Card struct {
	ArenaID *int `json:"arena_id"`
	ID string `json:"id"`
	Lang Lang `json:"lang"`
	OracleID string `json:"oracle_id"`
	MultiverseIDs []int `json:"multiverse_ids"`
	MTGOID *int `json:"mtgo_id"`
	MTGOFoilID *int `json:"mtgo_foil_id"`
	URI string `json:"uri"`
	ScryfallURI string `json:"scryfall_uri"`
	PrintsSearchURI string `json:"prints_search_uri"`
	RulingsURI string `json:"rulings_uri"`
	Name string `json:"name"`
	PrintedName *string `json:"printed_name"`
	Layout Layout `json:"layout"`
	CMC float64 `json:"cmc"`
	TypeLine string `json:"type_line"`
	PrintedTypeLine *string `json:"printed_type_line"`
	OracleText string `json:"oracle_text"`
	PrintedText *string `json:"printed_text"`
	ManaCost string `json:"mana_cost"`
	Power *string `json:"power"`
	Toughness *string `json:"toughness"`
	Loyalty *string `json:"loyalty"`
	LifeModifier *string `json:"life_modifier"`
	HandModifier *string `json:"hand_modifier"`
	Colors []Color `json:"colors"`
	ColorIndicator []Color `json:"color_indicator"`
	ColorIdentity []Color `json:"color_identity"`
	AllParts []RelatedCard `json:"all_parts"`
	CardFaces []CardFace `json:"card_faces"`
	Legalities Legalities `json:"legalities"`
	Reserved bool `json:"reserved"`
	Foil bool `json:"foil"`
	NonFoil bool `json:"nonfoil"`
	Oversized bool `json:"oversized"`
	Promo bool `json:"promo"`
	EDHRECRank *int `json:"edhrec_rank"`
	Set string `json:"set"`
	SetName string `json:"set_name"`
	CollectorNumber string `json:"collector_number"`
	SetURI string `json:"set_uri"`
	SetSearchURI string `json:"set_search_uri"`
	ScryfallSetURI string `json:"scryfall_set_uri"`
	ImageURIs *ImageURIs `json:"image_uris"`
	Prices Prices `json:"prices"`
	HighresImage bool `json:"highres_image"`
	Reprint bool `json:"reprint"`
	Digital bool `json:"digital"`
	Rarity string `json:"rarity"`
	FlavorText *string `json:"flavor_text"`
	Artist *string `json:"artist"`
	IllustrationID *string `json:"illustration_id"`
	Frame Frame `json:"frame"`
	FrameEffects []FrameEffect `json:"frame_effects"`
	FullArt bool `json:"full_art"`
	Watermark *string `json:"watermark"`
	Preview Preview `json:"preview"`
	BorderColor string `json:"border_color"`
	StorySpotlightNumber *int `json:"story_spotlight_number"`
	StorySpotlightURI *string `json:"story_spotlight_uri"`
	RelatedURIs RelatedURIs `json:"related_uris"`
	PurchaseURIs PurchaseURIs `json:"purchase_uris"`
}
type RelatedCard struct {
	ID string `json:"id"`
	Component Component `json:"component"`
	Name string `json:"name"`
	TypeLine string `json:"type_line"`
	URI string `json:"uri"`
}
type CardFace struct {
	Name string `json:"name"`
	PrintedName *string `json:"printed_name"`
	TypeLine string `json:"type_line"`
	PrintedTypeLine *string `json:"printed_type_line"`
	OracleText *string `json:"oracle_text"`
	PrintedText *string `json:"printed_text"`
	ManaCost string `json:"mana_cost"`
	Colors []Color `json:"colors"`
	ColorIndicator []Color `json:"color_indicator"`
	Power *string `json:"power"`
	Toughness *string `json:"toughness"`
	Loyalty *string `json:"loyalty"`
	FlavorText *string `json:"flavor_text"`
	IllustrationID *string `json:"illustration_id"`
	ImageURIs ImageURIs `json:"image_uris"`
}
type ImageURIs struct {
	Small string `json:"small"`
	Normal string `json:"normal"`
	Large string `json:"large"`
	PNG string `json:"png"`
	ArtCrop string `json:"art_crop"`
	BorderCrop string `json:"border_crop"`
}
type Prices struct {
	USD string `json:"usd"`
	USDFoil string `json:"usd_foil"`
	EUR string `json:"eur"`
	Tix string `json:"tix"`
}
type Legalities struct {
	Standard  Legality `json:"standard"`
	Modern    Legality `json:"modern"`
	Pauper    Legality `json:"pauper"`
	Pioneer   Legality `json:"pioneer"`
	Legacy    Legality `json:"legacy"`
	Penny     Legality `json:"penny"`
	Vintage   Legality `json:"vintage"`
	Duel      Legality `json:"duel"`
	Commander Legality `json:"commander"`
	Future    Legality `json:"future"`
}
type RelatedURIs struct {
	Gatherer       string `json:"gatherer"`
	TCGPlayerDecks string `json:"tcgplayer_decks"`
	EDHREC         string `json:"edhrec"`
	MTGTop8        string `json:"mtgtop8"`
}
type PurchaseURIs struct {
	TCGPlayer   string `json:"tcgplayer"`
	CardMarket  string `json:"cardmarket"`
	CardHoarder string `json:"cardhoarder"`
}
type UniqueMode string
const (
	UniqueModeCards UniqueMode = "cards"
	UniqueModeArt UniqueMode = "art"
	UniqueModePrints UniqueMode = "prints"
)
type Order string
const (
	OrderName Order = "name"
	OrderSet Order = "set"
	OrderRarity Order = "rarity"
	OrderColor Order = "color"
	OrderUSD Order = "usd"
	OrderTix Order = "tix"
	OrderEUR Order = "eur"
	OrderCMC Order = "cmc"
	OrderPower Order = "power"
	OrderToughness Order = "toughness"
	OrderEDHREC Order = "edhrec"
	OrderArtist Order = "artist"
)
type Dir string
const (
	DirAuto Dir = "auto"
	DirAsc Dir = "asc"
	DirDesc Dir = "desc"
)
type SearchCardsOptions struct {
	Unique UniqueMode `url:"unique,omitempty"`
	Order Order `url:"order,omitempty"`
	Dir Dir `url:"dir,omitempty"`
	IncludeExtras bool `url:"include_extras,omitempty"`
	IncludeMultilingual bool `url:"include_multilingual,omitempty"`
	IncludeVariations bool `url:"include_variations,omitempty"`
	Page int `url:"page,omitempty"`
}
type CardListResponse struct {
	Cards []Card `json:"data"`
	HasMore bool `json:"has_more"`
	NextPage *string `json:"next_page"`
	TotalCards int `json:"total_cards"`
	Warnings []string `json:"warnings"`
}
func (c *Client) SearchCards(ctx context.Context, query string, opts SearchCardsOptions) (CardListResponse, error) {
	values, err := qs.Values(opts)
	if err != nil {
		return CardListResponse{}, err
	}
	values.Set("q", query)
	cardsURL := fmt.Sprintf("cards/search?%s", values.Encode())
	result := CardListResponse{}
	err = c.get(ctx, cardsURL, &result)
	if err != nil {
		return CardListResponse{}, err
	}
	return result, nil
}
func (c *Client) getCard(ctx context.Context, url string) (Card, error) {
	card := Card{}
	err := c.get(ctx, url, &card)
	if err != nil {
		return Card{}, err
	}
	return card, nil
}
type GetCardByNameOptions struct {
	Set string `url:"set,omitempty"`
}