代码拉取完成,页面将自动刷新
package stripe
import "encoding/json"
// SKUInventoryType describe's the possible value for inventory type
type SKUInventoryType string
const (
SKUInventoryTypeBucket SKUInventoryType = "bucket"
SKUInventoryTypeFinite SKUInventoryType = "finite"
SKUInventoryTypeInfinite SKUInventoryType = "infinite"
)
// SKUInventoryValue describe's the possible value for inventory value
type SKUInventoryValue string
const (
SKUInventoryValueInStock SKUInventoryValue = "in_stock"
SKUInventoryValueLimited SKUInventoryValue = "limited"
SKUInventoryValueOutOfStock SKUInventoryValue = "out_of_stock"
)
type InventoryParams struct {
Quantity *int64 `form:"quantity"`
Type *string `form:"type"`
Value *string `form:"value"`
}
type SKUParams struct {
Params `form:"*"`
Active *bool `form:"active"`
Attributes map[string]string `form:"attributes"`
Currency *string `form:"currency"`
Description *string `form:"description"`
ID *string `form:"id"`
Image *string `form:"image"`
Inventory *InventoryParams `form:"inventory"`
PackageDimensions *PackageDimensionsParams `form:"package_dimensions"`
Price *int64 `form:"price"`
Product *string `form:"product"`
}
type Inventory struct {
Quantity int64 `json:"quantity"`
Type SKUInventoryType `json:"type"`
Value SKUInventoryValue `json:"value"`
}
type SKU struct {
Active bool `json:"active"`
Attributes map[string]string `json:"attributes"`
Created int64 `json:"created"`
Currency Currency `json:"currency"`
Description string `json:"description"`
ID string `json:"id"`
Image string `json:"image"`
Inventory *Inventory `json:"inventory"`
Livemode bool `json:"livemode"`
Metadata map[string]string `json:"metadata"`
PackageDimensions *PackageDimensions `json:"package_dimensions"`
Price int64 `json:"price"`
Product *Product `json:"product"`
Updated int64 `json:"updated"`
}
type SKUList struct {
ListMeta
Data []*SKU `json:"data"`
}
type SKUListParams struct {
ListParams `form:"*"`
Active *bool `form:"active"`
Attributes map[string]string `form:"attributes"`
IDs []*string `form:"ids"`
InStock *bool `form:"in_stock"`
Product *string `form:"product"`
}
func (s *SKU) UnmarshalJSON(data []byte) error {
if id, ok := ParseID(data); ok {
s.ID = id
return nil
}
type sku SKU
var v sku
if err := json.Unmarshal(data, &v); err != nil {
return err
}
*s = SKU(v)
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。