Skip to content

Commit 7d3452d

Browse files
authored
feat(marketing features): Adding Product Marketing Feature (#268)
1 parent 1d9fbc3 commit 7d3452d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Sources/StripeKit/Products/Products/Product.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ public struct Product: Codable {
4444
public var updated: Date?
4545
/// A URL of a publicly-accessible webpage for this product.
4646
public var url: String?
47+
/// The marketing feature name. Up to 80 characters long.
48+
public var marketingFeatures: [MarketingFeature]?
4749

4850
public init(id: String,
4951
active: Bool? = nil,
@@ -61,7 +63,8 @@ public struct Product: Codable {
6163
taxCode: String? = nil,
6264
unitLabel: String? = nil,
6365
updated: Date? = nil,
64-
url: String? = nil) {
66+
url: String? = nil,
67+
marketingFeatures: [MarketingFeature]? = []) {
6568
self.id = id
6669
self.active = active
6770
self._defaultPrice = Expandable(id: defaultPrice)
@@ -79,6 +82,15 @@ public struct Product: Codable {
7982
self.unitLabel = unitLabel
8083
self.updated = updated
8184
self.url = url
85+
self.marketingFeatures = marketingFeatures
86+
}
87+
}
88+
89+
public struct MarketingFeature: Codable {
90+
public var name: String?
91+
92+
public init(name: String? = nil) {
93+
self.name = name
8294
}
8395
}
8496

0 commit comments

Comments
 (0)