generated from NdoleStudio/go-http-client
-
Notifications
You must be signed in to change notification settings - Fork 17
/
order_item.go
28 lines (23 loc) · 1.07 KB
/
order_item.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
package lemonsqueezy
import "time"
// OrderItemAttributes is a line item for an order that includes product, variant and price information.
type OrderItemAttributes struct {
OrderID int `json:"order_id"`
ProductID int `json:"product_id"`
VariantID int `json:"variant_id"`
ProductName string `json:"product_name"`
VariantName string `json:"variant_name"`
Price int `json:"price"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// ApiResponseRelationshipsOrderItem relationships of an order-item
type ApiResponseRelationshipsOrderItem struct {
Order ApiResponseLinks `json:"order"`
Product ApiResponseLinks `json:"product"`
Variant ApiResponseLinks `json:"variant"`
}
// OrderItemApiResponse is the api response for one order item
type OrderItemApiResponse = ApiResponse[OrderItemAttributes, ApiResponseRelationshipsOrderItem]
// OrderItemsApiResponse is the api response for a list of order items.
type OrderItemsApiResponse = ApiResponseList[OrderItemAttributes, ApiResponseRelationshipsOrderItem]