leanpub-concepts-1.1.0.2: Types for the Leanpub API
Safe HaskellSafe-Inferred
LanguageHaskell2010

Leanpub.Concepts

Synopsis

API

newtype ApiSecretKey Source #

Get an API key from the Leanpub dashboard. This API key should be kept private; treat it just like your password to your Leanpub account.

Constructors

ApiSecretKey Text 

Books

newtype BookSlug Source #

An identifier for a book. E.g. if your book is found at

https://leanpub.com/your_book

then your book's slug is your_book.

Constructors

BookSlug Text 

Instances

Instances details
Show BookSlug Source # 
Instance details

Defined in Leanpub.Concepts

bookURL :: BookSlug -> Text Source #

>>> :set -XOverloadedStrings
>>> bookURL (BookSlug "your_book")
"https://leanpub.com/your_book"

Coupons

newtype CouponCode Source #

An identifier for a coupon.

Constructors

CouponCode Text 

Instances

Instances details
Show CouponCode Source # 
Instance details

Defined in Leanpub.Concepts

couponURL :: BookSlug -> CouponCode -> Text Source #

E.g. if your book's slug is your_book and the coupon code is black_friday then users can use your coupon via the URL:

https://leanpub.com/your_book/c/black_friday

(Don't just give the code at the end of the coupon to your potential customers, since there's nowhere to type it in on the checkout form.)

>>> :set -XOverloadedStrings
>>> couponURL (BookSlug "your_book") (CouponCode "black_friday")
"https://leanpub.com/your_book/c/black_friday"

data CouponMaxUses Source #

Constructors

CouponUseUnlimited

There is no limit to how many times the coupon may be used.

CouponMaxUses Natural

The maximum number of times the coupon may be used.

Instances

Instances details
Show CouponMaxUses Source # 
Instance details

Defined in Leanpub.Concepts

data CouponNote Source #

A description of a coupon. This is just used to remind you of what it was for; it is not visible to users.

Constructors

CouponNote Text 

Instances

Instances details
Show CouponNote Source # 
Instance details

Defined in Leanpub.Concepts