aboutsummaryrefslogtreecommitdiffstats
path: root/lulu.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2026-05-07 13:09:58 -0400
committerSam Anthony <sam@samanthony.xyz>2026-05-07 13:09:58 -0400
commitace7694bad5752aa38fec3a13c071cf7b2bebfce (patch)
tree2f391107b6aa7bce7b0a028aff8f7c5b32839852 /lulu.go
parentb57f03381e4bccba2963cebabe51a9cf32bd96dd (diff)
downloadlulu-ace7694bad5752aa38fec3a13c071cf7b2bebfce.zip
implement GET /validate-cover
Diffstat (limited to 'lulu.go')
-rw-r--r--lulu.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/lulu.go b/lulu.go
index 621cfc1..74ef526 100644
--- a/lulu.go
+++ b/lulu.go
@@ -165,6 +165,31 @@ func (c *Client) ValidateCover(srcUrl string, mfg PkgId, npages uint) (uint, err
return rec.Id, nil
}
+// GetCoverValidiation retrieves information about a cover file validation job that was started by ValidiateCover().
+//
+// https://api.lulu.com/docs/#tag/Files-validation/operation/Validate-Cover_read
+func (c *Client) GetCoverValidation(id uint) (CoverValidationRecord, error) {
+ url, err := url.JoinPath(ApiUrl, validateCoverPath, fmt.Sprint(id))
+ if err != nil {
+ return CoverValidationRecord{}, pkgErr(err)
+ }
+ resp, err := c.c.Get(url)
+ if err != nil {
+ return CoverValidationRecord{}, pkgErr(err)
+ }
+ defer resp.Body.Close()
+
+ if resp.StatusCode != http.StatusOK {
+ return CoverValidationRecord{}, pkgErr(errResp{resp})
+ }
+
+ var rec CoverValidationRecord
+ if err := decodeResponse(resp, &rec); err != nil {
+ return CoverValidationRecord{}, pkgErr(err)
+ }
+ return rec, nil
+}
+
func (c *Client) post(path string, payload any) (*http.Response, error) {
body, err := json.Marshal(payload)
if err != nil {