github.com/stripe/stripe-go/v76@v76.25.0/issuing_personalizationdesign.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 reason(s) the card logo was rejected. 12 type IssuingPersonalizationDesignRejectionReasonsCardLogo string 13 14 // List of values that IssuingPersonalizationDesignRejectionReasonsCardLogo can take 15 const ( 16 IssuingPersonalizationDesignRejectionReasonsCardLogoGeographicLocation IssuingPersonalizationDesignRejectionReasonsCardLogo = "geographic_location" 17 IssuingPersonalizationDesignRejectionReasonsCardLogoInappropriate IssuingPersonalizationDesignRejectionReasonsCardLogo = "inappropriate" 18 IssuingPersonalizationDesignRejectionReasonsCardLogoNetworkName IssuingPersonalizationDesignRejectionReasonsCardLogo = "network_name" 19 IssuingPersonalizationDesignRejectionReasonsCardLogoNonBinaryImage IssuingPersonalizationDesignRejectionReasonsCardLogo = "non_binary_image" 20 IssuingPersonalizationDesignRejectionReasonsCardLogoNonFiatCurrency IssuingPersonalizationDesignRejectionReasonsCardLogo = "non_fiat_currency" 21 IssuingPersonalizationDesignRejectionReasonsCardLogoOther IssuingPersonalizationDesignRejectionReasonsCardLogo = "other" 22 IssuingPersonalizationDesignRejectionReasonsCardLogoOtherEntity IssuingPersonalizationDesignRejectionReasonsCardLogo = "other_entity" 23 IssuingPersonalizationDesignRejectionReasonsCardLogoPromotionalMaterial IssuingPersonalizationDesignRejectionReasonsCardLogo = "promotional_material" 24 ) 25 26 // The reason(s) the carrier text was rejected. 27 type IssuingPersonalizationDesignRejectionReasonsCarrierText string 28 29 // List of values that IssuingPersonalizationDesignRejectionReasonsCarrierText can take 30 const ( 31 IssuingPersonalizationDesignRejectionReasonsCarrierTextGeographicLocation IssuingPersonalizationDesignRejectionReasonsCarrierText = "geographic_location" 32 IssuingPersonalizationDesignRejectionReasonsCarrierTextInappropriate IssuingPersonalizationDesignRejectionReasonsCarrierText = "inappropriate" 33 IssuingPersonalizationDesignRejectionReasonsCarrierTextNetworkName IssuingPersonalizationDesignRejectionReasonsCarrierText = "network_name" 34 IssuingPersonalizationDesignRejectionReasonsCarrierTextNonFiatCurrency IssuingPersonalizationDesignRejectionReasonsCarrierText = "non_fiat_currency" 35 IssuingPersonalizationDesignRejectionReasonsCarrierTextOther IssuingPersonalizationDesignRejectionReasonsCarrierText = "other" 36 IssuingPersonalizationDesignRejectionReasonsCarrierTextOtherEntity IssuingPersonalizationDesignRejectionReasonsCarrierText = "other_entity" 37 IssuingPersonalizationDesignRejectionReasonsCarrierTextPromotionalMaterial IssuingPersonalizationDesignRejectionReasonsCarrierText = "promotional_material" 38 ) 39 40 // Whether this personalization design can be used to create cards. 41 type IssuingPersonalizationDesignStatus string 42 43 // List of values that IssuingPersonalizationDesignStatus can take 44 const ( 45 IssuingPersonalizationDesignStatusActive IssuingPersonalizationDesignStatus = "active" 46 IssuingPersonalizationDesignStatusInactive IssuingPersonalizationDesignStatus = "inactive" 47 IssuingPersonalizationDesignStatusRejected IssuingPersonalizationDesignStatus = "rejected" 48 IssuingPersonalizationDesignStatusReview IssuingPersonalizationDesignStatus = "review" 49 ) 50 51 // Only return personalization designs with the given preferences. 52 type IssuingPersonalizationDesignListPreferencesParams struct { 53 // Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. 54 IsDefault *bool `form:"is_default"` 55 // Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. 56 IsPlatformDefault *bool `form:"is_platform_default"` 57 } 58 59 // Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. 60 type IssuingPersonalizationDesignListParams struct { 61 ListParams `form:"*"` 62 // Specifies which fields in the response should be expanded. 63 Expand []*string `form:"expand"` 64 // Only return personalization designs with the given lookup keys. 65 LookupKeys []*string `form:"lookup_keys"` 66 // Only return personalization designs with the given preferences. 67 Preferences *IssuingPersonalizationDesignListPreferencesParams `form:"preferences"` 68 // Only return personalization designs with the given status. 69 Status *string `form:"status"` 70 } 71 72 // AddExpand appends a new field to expand. 73 func (p *IssuingPersonalizationDesignListParams) AddExpand(f string) { 74 p.Expand = append(p.Expand, &f) 75 } 76 77 // Hash containing carrier text, for use with physical bundles that support carrier text. 78 type IssuingPersonalizationDesignCarrierTextParams struct { 79 // The footer body text of the carrier letter. 80 FooterBody *string `form:"footer_body"` 81 // The footer title text of the carrier letter. 82 FooterTitle *string `form:"footer_title"` 83 // The header body text of the carrier letter. 84 HeaderBody *string `form:"header_body"` 85 // The header title text of the carrier letter. 86 HeaderTitle *string `form:"header_title"` 87 } 88 89 // Information on whether this personalization design is used to create cards when one is not specified. 90 type IssuingPersonalizationDesignPreferencesParams struct { 91 // Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. 92 IsDefault *bool `form:"is_default"` 93 } 94 95 // Creates a personalization design object. 96 type IssuingPersonalizationDesignParams struct { 97 Params `form:"*"` 98 // The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. 99 CardLogo *string `form:"card_logo"` 100 // Hash containing carrier text, for use with physical bundles that support carrier text. 101 CarrierText *IssuingPersonalizationDesignCarrierTextParams `form:"carrier_text"` 102 // Specifies which fields in the response should be expanded. 103 Expand []*string `form:"expand"` 104 // A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. 105 LookupKey *string `form:"lookup_key"` 106 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. 107 Metadata map[string]string `form:"metadata"` 108 // Friendly display name. Providing an empty string will set the field to null. 109 Name *string `form:"name"` 110 // The physical bundle object belonging to this personalization design. 111 PhysicalBundle *string `form:"physical_bundle"` 112 // Information on whether this personalization design is used to create cards when one is not specified. 113 Preferences *IssuingPersonalizationDesignPreferencesParams `form:"preferences"` 114 // If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. 115 TransferLookupKey *bool `form:"transfer_lookup_key"` 116 } 117 118 // AddExpand appends a new field to expand. 119 func (p *IssuingPersonalizationDesignParams) AddExpand(f string) { 120 p.Expand = append(p.Expand, &f) 121 } 122 123 // AddMetadata adds a new key-value pair to the Metadata. 124 func (p *IssuingPersonalizationDesignParams) AddMetadata(key string, value string) { 125 if p.Metadata == nil { 126 p.Metadata = make(map[string]string) 127 } 128 129 p.Metadata[key] = value 130 } 131 132 // Hash containing carrier text, for use with physical bundles that support carrier text. 133 type IssuingPersonalizationDesignCarrierText struct { 134 // The footer body text of the carrier letter. 135 FooterBody string `json:"footer_body"` 136 // The footer title text of the carrier letter. 137 FooterTitle string `json:"footer_title"` 138 // The header body text of the carrier letter. 139 HeaderBody string `json:"header_body"` 140 // The header title text of the carrier letter. 141 HeaderTitle string `json:"header_title"` 142 } 143 type IssuingPersonalizationDesignPreferences struct { 144 // Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. 145 IsDefault bool `json:"is_default"` 146 // Whether this personalization design is used to create cards when one is not specified and a default for this connected account does not exist. 147 IsPlatformDefault bool `json:"is_platform_default"` 148 } 149 type IssuingPersonalizationDesignRejectionReasons struct { 150 // The reason(s) the card logo was rejected. 151 CardLogo []IssuingPersonalizationDesignRejectionReasonsCardLogo `json:"card_logo"` 152 // The reason(s) the carrier text was rejected. 153 CarrierText []IssuingPersonalizationDesignRejectionReasonsCarrierText `json:"carrier_text"` 154 } 155 156 // A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line. 157 type IssuingPersonalizationDesign struct { 158 APIResource 159 // The file for the card logo to use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. 160 CardLogo *File `json:"card_logo"` 161 // Hash containing carrier text, for use with physical bundles that support carrier text. 162 CarrierText *IssuingPersonalizationDesignCarrierText `json:"carrier_text"` 163 // Time at which the object was created. Measured in seconds since the Unix epoch. 164 Created int64 `json:"created"` 165 // Unique identifier for the object. 166 ID string `json:"id"` 167 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 168 Livemode bool `json:"livemode"` 169 // A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. 170 LookupKey string `json:"lookup_key"` 171 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 172 Metadata map[string]string `json:"metadata"` 173 // Friendly display name. 174 Name string `json:"name"` 175 // String representing the object's type. Objects of the same type share the same value. 176 Object string `json:"object"` 177 // The physical bundle object belonging to this personalization design. 178 PhysicalBundle *IssuingPhysicalBundle `json:"physical_bundle"` 179 Preferences *IssuingPersonalizationDesignPreferences `json:"preferences"` 180 RejectionReasons *IssuingPersonalizationDesignRejectionReasons `json:"rejection_reasons"` 181 // Whether this personalization design can be used to create cards. 182 Status IssuingPersonalizationDesignStatus `json:"status"` 183 } 184 185 // IssuingPersonalizationDesignList is a list of PersonalizationDesigns as retrieved from a list endpoint. 186 type IssuingPersonalizationDesignList struct { 187 APIResource 188 ListMeta 189 Data []*IssuingPersonalizationDesign `json:"data"` 190 } 191 192 // UnmarshalJSON handles deserialization of an IssuingPersonalizationDesign. 193 // This custom unmarshaling is needed because the resulting 194 // property may be an id or the full struct if it was expanded. 195 func (i *IssuingPersonalizationDesign) UnmarshalJSON(data []byte) error { 196 if id, ok := ParseID(data); ok { 197 i.ID = id 198 return nil 199 } 200 201 type issuingPersonalizationDesign IssuingPersonalizationDesign 202 var v issuingPersonalizationDesign 203 if err := json.Unmarshal(data, &v); err != nil { 204 return err 205 } 206 207 *i = IssuingPersonalizationDesign(v) 208 return nil 209 }