generated from NdoleStudio/go-http-client
-
Notifications
You must be signed in to change notification settings - Fork 17
/
product.go
37 lines (32 loc) · 1.53 KB
/
product.go
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
package lemonsqueezy
import "time"
// ProductAttributes are the attributes of a lemonsqueezy product
type ProductAttributes struct {
StoreID int `json:"store_id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Status string `json:"status"`
StatusFormatted string `json:"status_formatted"`
ThumbURL string `json:"thumb_url"`
LargeThumbURL string `json:"large_thumb_url"`
Price any `json:"price"`
PayWhatYouWant bool `json:"pay_what_you_want"`
FromPrice *int `json:"from_price"`
FromPriceFormatted *string `json:"from_price_formatted"`
ToPrice *int `json:"to_price"`
ToPriceFormatted *string `json:"to_price_formatted"`
BuyNowURL string `json:"buy_now_url"`
PriceFormatted string `json:"price_formatted"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// ApiResponseRelationshipsProduct relationships of a product
type ApiResponseRelationshipsProduct struct {
Store ApiResponseLinks `json:"store"`
Variants ApiResponseLinks `json:"variants"`
}
// ProductApiResponse represents a product api response
type ProductApiResponse = ApiResponse[ProductAttributes, ApiResponseRelationshipsProduct]
// ProductsApiResponse represents a list of products api responses.
type ProductsApiResponse = ApiResponseList[ProductAttributes, ApiResponseRelationshipsProduct]