github.com/stripe/stripe-go/v76@v76.25.0/entitlements_feature.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // Retrieve a list of features 10 type EntitlementsFeatureListParams struct { 11 ListParams `form:"*"` 12 // Specifies which fields in the response should be expanded. 13 Expand []*string `form:"expand"` 14 } 15 16 // AddExpand appends a new field to expand. 17 func (p *EntitlementsFeatureListParams) AddExpand(f string) { 18 p.Expand = append(p.Expand, &f) 19 } 20 21 // Creates a feature 22 type EntitlementsFeatureParams struct { 23 Params `form:"*"` 24 // Inactive features cannot be attached to new products and will not be returned from the features list endpoint. 25 Active *bool `form:"active"` 26 // Specifies which fields in the response should be expanded. 27 Expand []*string `form:"expand"` 28 // A unique key you provide as your own system identifier. This may be up to 80 characters. 29 LookupKey *string `form:"lookup_key"` 30 // 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. 31 Metadata map[string]string `form:"metadata"` 32 // The feature's name, for your own purpose, not meant to be displayable to the customer. 33 Name *string `form:"name"` 34 } 35 36 // AddExpand appends a new field to expand. 37 func (p *EntitlementsFeatureParams) AddExpand(f string) { 38 p.Expand = append(p.Expand, &f) 39 } 40 41 // AddMetadata adds a new key-value pair to the Metadata. 42 func (p *EntitlementsFeatureParams) AddMetadata(key string, value string) { 43 if p.Metadata == nil { 44 p.Metadata = make(map[string]string) 45 } 46 47 p.Metadata[key] = value 48 } 49 50 // A feature represents a monetizable ability or functionality in your system. 51 // Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. 52 type EntitlementsFeature struct { 53 APIResource 54 // Inactive features cannot be attached to new products and will not be returned from the features list endpoint. 55 Active bool `json:"active"` 56 // Unique identifier for the object. 57 ID string `json:"id"` 58 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 59 Livemode bool `json:"livemode"` 60 // A unique key you provide as your own system identifier. This may be up to 80 characters. 61 LookupKey string `json:"lookup_key"` 62 // 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. 63 Metadata map[string]string `json:"metadata"` 64 // The feature's name, for your own purpose, not meant to be displayable to the customer. 65 Name string `json:"name"` 66 // String representing the object's type. Objects of the same type share the same value. 67 Object string `json:"object"` 68 } 69 70 // EntitlementsFeatureList is a list of Features as retrieved from a list endpoint. 71 type EntitlementsFeatureList struct { 72 APIResource 73 ListMeta 74 Data []*EntitlementsFeature `json:"data"` 75 }