diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2026-05-05 18:10:38 -0400 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2026-05-05 18:10:38 -0400 |
| commit | b6b81ac135e77f7856efb07389a6ac42cc137a6e (patch) | |
| tree | 9610e825a77ec036d4a811c3947c2d0fb77b5d35 /pod.go | |
| download | lulu-b6b81ac135e77f7856efb07389a6ac42cc137a6e.zip | |
pod_package_id
Diffstat (limited to 'pod.go')
| -rw-r--r-- | pod.go | 117 |
1 files changed, 117 insertions, 0 deletions
@@ -0,0 +1,117 @@ +package lulu + +import ( + "encoding/json" + "fmt" +) + +// PodPkgId is a pod_package_id which represents the manufacturing options. +// https://api.lulu.com/docs/#section/Getting-Started/Select-a-Product +type PodPkgId struct { + TrimSize + ColorType + Quality + Binding + Paper + Finish + Linen + Foil +} + +func (pod PodPkgId) MarshalJSON() ([]byte, error) { + return json.Marshal(fmt.Sprintf("%s.%s.%s.%s.%s.%s%s%s", pod.TrimSize, pod.ColorType, pod.Quality, pod.Binding, pod.Paper, pod.Finish, pod.Linen, pod.Foil)) +} + +// TrimSize is the final dimensions of the pages after the bleed margins +// are trimmed off. +type TrimSize string + +const ( + Pocketbook TrimSize = "0425X0687" + Novella = "0500X0800" + Digest = "0550X0850" + A5 = "0583X0827" + UsTrade = "0600X0900" + Royal = "0614X0921" + Comic = "0663X1025" + SmallSquare = "0750X0750" + Executive = "0700X1000" + CrownQuatro = "0744X0968" + Square = "0850X0850" + A4 = "0827X1169" + UsLetter = "0850X1100" + Landscape = "0900X0700" + UsLetterLandscape = "1100X0850" + A4Landscape = "1169X0827" +) + +// ColorType is the color mode of the printer. +type ColorType string + +const ( + Mono ColorType = "BW" + Color = "FC" +) + +// Quality is the print quality. +type Quality string + +const ( + Premium Quality = "PRE" + Standard = "STD" +) + +type Binding string + +const ( + Perfect Binding = "PB" + Coil = "CO" + SaddleStitch = "SS" + CaseWrap = "CW" + LinenWrap = "LW" + WireO = "WO" +) + +// Paper is the weight/thickness and hue of the paper. +type Paper string + +const ( + P60UncoatedWhite Paper = "060UW444" + P60UncoatedCream = "060UC444" + P70CoatedWhite = "070CW460" + P80CoatedWhite = "080CW444" + P100CoatedWhite = "100CW" +) + +// Finish is the surface finish of the cover. +type Finish string + +const ( + Gloss Finish = "G" + Matte = "M" + Unlaminated = "U" +) + +// Linen is the color of the linen-wrapped cover, if applicable. +type Linen string + +const ( + RedLinen Linen = "R" + NavyLinen = "N" + BlackLinen = "B" + GrayLinen = "G" + TanLinen = "T" + ForestLinen = "F" + InteriorCoverPrint = "I" + NoLinen = "X" +) + +// Foil is the color of the foil stamping, if applicable. +type Foil string + +const ( + GoldFoil Foil = "G" + BlackFoil = "B" + WhiteFoil = "W" + NoFoil = "X" +) |