@@ -61,7 +61,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
6161 ]
6262
6363 let path = " \( Path . products) / \( productID) /variations "
64- let request = JetpackRequest ( wooApiVersion: . mark3, method: . get, siteID: siteID, path: path, parameters: parameters, availableAsRESTRequest: true )
64+ let request = JetpackRequest ( wooApiVersion: . mark3,
65+ method: . get,
66+ siteID: siteID,
67+ path: path,
68+ parameters: parameters,
69+ availableAsRESTRequest: true )
6570 let mapper = ProductVariationListMapper ( siteID: siteID, productID: productID)
6671 enqueue ( request, mapper: mapper, completion: completion)
6772 }
@@ -76,7 +81,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
7681 ///
7782 public func loadProductVariation( for siteID: Int64 , productID: Int64 , variationID: Int64 , completion: @escaping ( Result < ProductVariation , Error > ) -> Void ) {
7883 let path = " \( Path . products) / \( productID) /variations/ \( variationID) "
79- let request = JetpackRequest ( wooApiVersion: . mark3, method: . get, siteID: siteID, path: path, parameters: nil , availableAsRESTRequest: true )
84+ let request = JetpackRequest ( wooApiVersion: . mark3,
85+ method: . get,
86+ siteID: siteID,
87+ path: path,
88+ parameters: nil ,
89+ availableAsRESTRequest: true )
8090 let mapper = ProductVariationMapper ( siteID: siteID, productID: productID)
8191
8292 enqueue ( request, mapper: mapper, completion: completion)
@@ -98,7 +108,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
98108 let parameters = try newVariation. toDictionary ( )
99109
100110 let path = " \( Path . products) / \( productID) /variations "
101- let request = JetpackRequest ( wooApiVersion: . mark3, method: . post, siteID: siteID, path: path, parameters: parameters, availableAsRESTRequest: true )
111+ let request = JetpackRequest ( wooApiVersion: . mark3,
112+ method: . post,
113+ siteID: siteID,
114+ path: path,
115+ parameters: parameters,
116+ availableAsRESTRequest: true )
102117 let mapper = ProductVariationMapper ( siteID: siteID, productID: productID)
103118 enqueue ( request, mapper: mapper, completion: completion)
104119 } catch {
@@ -122,7 +137,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
122137 do {
123138 let parameters = try productVariations. map { try $0. toDictionary ( ) }
124139 let path = " \( Path . products) / \( productID) /variations/batch "
125- let request = JetpackRequest ( wooApiVersion: . mark3, method: . post, siteID: siteID, path: path, parameters: [ " create " : parameters] , availableAsRESTRequest: true )
140+ let request = JetpackRequest ( wooApiVersion: . mark3,
141+ method: . post,
142+ siteID: siteID,
143+ path: path,
144+ parameters: [ " create " : parameters] ,
145+ availableAsRESTRequest: true )
126146 let mapper = ProductVariationsBulkCreateMapper ( siteID: siteID, productID: productID)
127147
128148 enqueue ( request, mapper: mapper, completion: completion)
@@ -143,7 +163,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
143163 let productID = productVariation. productID
144164 let siteID = productVariation. siteID
145165 let path = " \( Path . products) / \( productID) /variations/ \( productVariation. productVariationID) "
146- let request = JetpackRequest ( wooApiVersion: . mark3, method: . post, siteID: siteID, path: path, parameters: parameters, availableAsRESTRequest: true )
166+ let request = JetpackRequest ( wooApiVersion: . mark3,
167+ method: . post,
168+ siteID: siteID,
169+ path: path,
170+ parameters: parameters,
171+ availableAsRESTRequest: true )
147172 let mapper = ProductVariationMapper ( siteID: siteID, productID: productID)
148173
149174 enqueue ( request, mapper: mapper, completion: completion)
@@ -168,7 +193,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
168193 do {
169194 let parameters = try ( [ ParameterKey . image: image] ) . toDictionary ( )
170195 let path = " \( Path . products) / \( productID) /variations/ \( variationID) "
171- let request = JetpackRequest ( wooApiVersion: . mark3, method: . post, siteID: siteID, path: path, parameters: parameters, availableAsRESTRequest: true )
196+ let request = JetpackRequest ( wooApiVersion: . mark3,
197+ method: . post,
198+ siteID: siteID,
199+ path: path,
200+ parameters: parameters,
201+ availableAsRESTRequest: true )
172202 let mapper = ProductVariationMapper ( siteID: siteID, productID: productID)
173203
174204 enqueue ( request, mapper: mapper, completion: completion)
@@ -193,7 +223,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
193223 do {
194224 let parameters = try productVariations. map { try $0. toDictionary ( ) }
195225 let path = " \( Path . products) / \( productID) /variations/batch "
196- let request = JetpackRequest ( wooApiVersion: . mark3, method: . post, siteID: siteID, path: path, parameters: [ " update " : parameters] , availableAsRESTRequest: true )
226+ let request = JetpackRequest ( wooApiVersion: . mark3,
227+ method: . post,
228+ siteID: siteID,
229+ path: path,
230+ parameters: [ " update " : parameters] ,
231+ availableAsRESTRequest: true )
197232 let mapper = ProductVariationsBulkUpdateMapper ( siteID: siteID, productID: productID)
198233
199234 enqueue ( request, mapper: mapper, completion: completion)
@@ -212,7 +247,12 @@ public class ProductVariationsRemote: Remote, ProductVariationsRemoteProtocol {
212247 ///
213248 public func deleteProductVariation( siteID: Int64 , productID: Int64 , variationID: Int64 , completion: @escaping ( Result < ProductVariation , Error > ) -> Void ) {
214249 let path = " \( Path . products) / \( productID) /variations/ \( variationID) "
215- let request = JetpackRequest ( wooApiVersion: . mark3, method: . delete, siteID: siteID, path: path, parameters: [ " force " : true ] , availableAsRESTRequest: true )
250+ let request = JetpackRequest ( wooApiVersion: . mark3,
251+ method: . delete,
252+ siteID: siteID,
253+ path: path,
254+ parameters: [ " force " : true ] ,
255+ availableAsRESTRequest: true )
216256 let mapper = ProductVariationMapper ( siteID: siteID, productID: productID)
217257
218258 enqueue ( request, mapper: mapper, completion: completion)
0 commit comments