aboutsummaryrefslogtreecommitdiffstats
path: root/pod.go
blob: 2796a80c55db02be671bc5e9d36d7a3b62e9c833 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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"
)