/
entitlements_feature.go
75 lines (66 loc) · 2.89 KB
/
entitlements_feature.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
//
// File generated from our OpenAPI spec
//
//
package stripe
// Retrieve a list of features
type EntitlementsFeatureListParams struct {
ListParams `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
}
// AddExpand appends a new field to expand.
func (p *EntitlementsFeatureListParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
// Creates a feature
type EntitlementsFeatureParams struct {
Params `form:"*"`
// Inactive features cannot be attached to new products and will not be returned from the features list endpoint.
Active *bool `form:"active"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// A unique key you provide as your own system identifier. This may be up to 80 characters.
LookupKey *string `form:"lookup_key"`
// Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Metadata map[string]string `form:"metadata"`
// The feature's name, for your own purpose, not meant to be displayable to the customer.
Name *string `form:"name"`
}
// AddExpand appends a new field to expand.
func (p *EntitlementsFeatureParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
// AddMetadata adds a new key-value pair to the Metadata.
func (p *EntitlementsFeatureParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}
p.Metadata[key] = value
}
// A feature represents a monetizable ability or functionality in your system.
// Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.
type EntitlementsFeature struct {
APIResource
// Inactive features cannot be attached to new products and will not be returned from the features list endpoint.
Active bool `json:"active"`
// Unique identifier for the object.
ID string `json:"id"`
// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
Livemode bool `json:"livemode"`
// A unique key you provide as your own system identifier. This may be up to 80 characters.
LookupKey string `json:"lookup_key"`
// Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Metadata map[string]string `json:"metadata"`
// The feature's name, for your own purpose, not meant to be displayable to the customer.
Name string `json:"name"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
}
// EntitlementsFeatureList is a list of Features as retrieved from a list endpoint.
type EntitlementsFeatureList struct {
APIResource
ListMeta
Data []*EntitlementsFeature `json:"data"`
}