diff options
Diffstat (limited to 'print.go')
| -rw-r--r-- | print.go | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -11,10 +11,10 @@ const ( MaxProductionDelay = 48 * time.Hour ) -type printReq struct { +type printReq[P Printable | Reprintable] struct { Contact EmailAddress `json:"contact_email"` ExternalId string `json:"external_id"` - LineItems []Printable `json:"line_items"` + LineItems []P `json:"line_items"` ProductionDelayMins uint `json:"production_delay"` ShipAddr ShippingAddress `json:"shipping_address"` ShipOpt ShippingLevel `json:"shipping_level"` @@ -52,6 +52,24 @@ type Printable struct { Title string `json:"title"` } +// Reprintable is a printable whose PrintableId is known from an prior +// print job. +type Reprintable struct { + // Arbitrary string to identify and connect a print job to your + // systems. Set it to an order number, a purchase order or + // whatever else works for your particular use case. + ExternalId string `json:"external_id"` + + // Uniquely identifies the printable. + PrintableId PrintableId `json:"printable_id"` + + // The number of copies to print. + Quantity uint `json:"quantity"` + + // The title of the book. Must not exceed 255 bytes. + Title string `json:"title"` +} + type getPrintJobsResp struct { Count uint `json:"count"` Next string `json:"next"` |