github.com/stripe/stripe-go/v76@v76.25.0/issuing_physicalbundle.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 import "encoding/json" 10 11 // The policy for how to use card logo images in a card design with this physical bundle. 12 type IssuingPhysicalBundleFeaturesCardLogo string 13 14 // List of values that IssuingPhysicalBundleFeaturesCardLogo can take 15 const ( 16 IssuingPhysicalBundleFeaturesCardLogoOptional IssuingPhysicalBundleFeaturesCardLogo = "optional" 17 IssuingPhysicalBundleFeaturesCardLogoRequired IssuingPhysicalBundleFeaturesCardLogo = "required" 18 IssuingPhysicalBundleFeaturesCardLogoUnsupported IssuingPhysicalBundleFeaturesCardLogo = "unsupported" 19 ) 20 21 // The policy for how to use carrier letter text in a card design with this physical bundle. 22 type IssuingPhysicalBundleFeaturesCarrierText string 23 24 // List of values that IssuingPhysicalBundleFeaturesCarrierText can take 25 const ( 26 IssuingPhysicalBundleFeaturesCarrierTextOptional IssuingPhysicalBundleFeaturesCarrierText = "optional" 27 IssuingPhysicalBundleFeaturesCarrierTextRequired IssuingPhysicalBundleFeaturesCarrierText = "required" 28 IssuingPhysicalBundleFeaturesCarrierTextUnsupported IssuingPhysicalBundleFeaturesCarrierText = "unsupported" 29 ) 30 31 // The policy for how to use a second line on a card with this physical bundle. 32 type IssuingPhysicalBundleFeaturesSecondLine string 33 34 // List of values that IssuingPhysicalBundleFeaturesSecondLine can take 35 const ( 36 IssuingPhysicalBundleFeaturesSecondLineOptional IssuingPhysicalBundleFeaturesSecondLine = "optional" 37 IssuingPhysicalBundleFeaturesSecondLineRequired IssuingPhysicalBundleFeaturesSecondLine = "required" 38 IssuingPhysicalBundleFeaturesSecondLineUnsupported IssuingPhysicalBundleFeaturesSecondLine = "unsupported" 39 ) 40 41 // Whether this physical bundle can be used to create cards. 42 type IssuingPhysicalBundleStatus string 43 44 // List of values that IssuingPhysicalBundleStatus can take 45 const ( 46 IssuingPhysicalBundleStatusActive IssuingPhysicalBundleStatus = "active" 47 IssuingPhysicalBundleStatusInactive IssuingPhysicalBundleStatus = "inactive" 48 IssuingPhysicalBundleStatusReview IssuingPhysicalBundleStatus = "review" 49 ) 50 51 // Whether this physical bundle is a standard Stripe offering or custom-made for you. 52 type IssuingPhysicalBundleType string 53 54 // List of values that IssuingPhysicalBundleType can take 55 const ( 56 IssuingPhysicalBundleTypeCustom IssuingPhysicalBundleType = "custom" 57 IssuingPhysicalBundleTypeStandard IssuingPhysicalBundleType = "standard" 58 ) 59 60 // Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. 61 type IssuingPhysicalBundleListParams struct { 62 ListParams `form:"*"` 63 // Specifies which fields in the response should be expanded. 64 Expand []*string `form:"expand"` 65 // Only return physical bundles with the given status. 66 Status *string `form:"status"` 67 // Only return physical bundles with the given type. 68 Type *string `form:"type"` 69 } 70 71 // AddExpand appends a new field to expand. 72 func (p *IssuingPhysicalBundleListParams) AddExpand(f string) { 73 p.Expand = append(p.Expand, &f) 74 } 75 76 // Retrieves a physical bundle object. 77 type IssuingPhysicalBundleParams struct { 78 Params `form:"*"` 79 // Specifies which fields in the response should be expanded. 80 Expand []*string `form:"expand"` 81 } 82 83 // AddExpand appends a new field to expand. 84 func (p *IssuingPhysicalBundleParams) AddExpand(f string) { 85 p.Expand = append(p.Expand, &f) 86 } 87 88 type IssuingPhysicalBundleFeatures struct { 89 // The policy for how to use card logo images in a card design with this physical bundle. 90 CardLogo IssuingPhysicalBundleFeaturesCardLogo `json:"card_logo"` 91 // The policy for how to use carrier letter text in a card design with this physical bundle. 92 CarrierText IssuingPhysicalBundleFeaturesCarrierText `json:"carrier_text"` 93 // The policy for how to use a second line on a card with this physical bundle. 94 SecondLine IssuingPhysicalBundleFeaturesSecondLine `json:"second_line"` 95 } 96 97 // A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. 98 type IssuingPhysicalBundle struct { 99 APIResource 100 Features *IssuingPhysicalBundleFeatures `json:"features"` 101 // Unique identifier for the object. 102 ID string `json:"id"` 103 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 104 Livemode bool `json:"livemode"` 105 // Friendly display name. 106 Name string `json:"name"` 107 // String representing the object's type. Objects of the same type share the same value. 108 Object string `json:"object"` 109 // Whether this physical bundle can be used to create cards. 110 Status IssuingPhysicalBundleStatus `json:"status"` 111 // Whether this physical bundle is a standard Stripe offering or custom-made for you. 112 Type IssuingPhysicalBundleType `json:"type"` 113 } 114 115 // IssuingPhysicalBundleList is a list of PhysicalBundles as retrieved from a list endpoint. 116 type IssuingPhysicalBundleList struct { 117 APIResource 118 ListMeta 119 Data []*IssuingPhysicalBundle `json:"data"` 120 } 121 122 // UnmarshalJSON handles deserialization of an IssuingPhysicalBundle. 123 // This custom unmarshaling is needed because the resulting 124 // property may be an id or the full struct if it was expanded. 125 func (i *IssuingPhysicalBundle) UnmarshalJSON(data []byte) error { 126 if id, ok := ParseID(data); ok { 127 i.ID = id 128 return nil 129 } 130 131 type issuingPhysicalBundle IssuingPhysicalBundle 132 var v issuingPhysicalBundle 133 if err := json.Unmarshal(data, &v); err != nil { 134 return err 135 } 136 137 *i = IssuingPhysicalBundle(v) 138 return nil 139 }