File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Networking/Networking/Model Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff 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+
172199extension DotcomUser {
173200 public func copy(
174201 id: CopiableProp < Int64 > = . copy,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments