Skip to content

Commit 6fb5ee4

Browse files
committed
Added GeneratedCopiable to Customer model
1 parent 4d4668a commit 6fb5ee4

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

Networking/Networking/Model/Copiable/Models+Copiable.generated.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,33 @@ extension CouponReport {
169169
}
170170
}
171171

172+
extension Customer {
173+
func copy(
174+
customerID: CopiableProp<Int64> = .copy,
175+
email: CopiableProp<String> = .copy,
176+
firstName: NullableCopiableProp<String> = .copy,
177+
lastName: NullableCopiableProp<String> = .copy,
178+
billing: NullableCopiableProp<Address> = .copy,
179+
shipping: NullableCopiableProp<Address> = .copy
180+
) -> Customer {
181+
let customerID = customerID ?? self.customerID
182+
let email = email ?? self.email
183+
let firstName = firstName ?? self.firstName
184+
let lastName = lastName ?? self.lastName
185+
let billing = billing ?? self.billing
186+
let shipping = shipping ?? self.shipping
187+
188+
return Customer(
189+
customerID: customerID,
190+
email: email,
191+
firstName: firstName,
192+
lastName: lastName,
193+
billing: billing,
194+
shipping: shipping
195+
)
196+
}
197+
}
198+
172199
extension DotcomUser {
173200
public func copy(
174201
id: CopiableProp<Int64> = .copy,

Networking/Networking/Model/Customer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Codegen
44
/// Represents a Customer entity:
55
/// https://woocommerce.github.io/woocommerce-rest-api-docs/#customer-properties
66
///
7-
struct Customer: Codable {
7+
struct Customer: Codable, GeneratedCopiable {
88

99
/// Unique identifier for the customer
1010
let customerID: Int64

0 commit comments

Comments
 (0)